Fix xargs misbehaving when there are no packages
Adding the -r argument to xargs makes it not run for no reason when there are no packages to trim spaces from. Otherwise it'd always run at least once and sometimes misbehave.
This commit is contained in:
parent
39a5c0ca67
commit
7f35cdc86a
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ table_start=$(echo "$package_list" | grep -n "S | Repository | Name"| gawk '{pri
|
||||||
|
|
||||||
unneeded_packages=()
|
unneeded_packages=()
|
||||||
while IFS= read -r package; do
|
while IFS= read -r package; do
|
||||||
package="$(echo "$package"| awk -F '|' '{ print $3 }' | xargs)"
|
package="$(echo "$package"| awk -F '|' '{ print $3 }' | xargs -r)"
|
||||||
unneeded_packages+=("$package")
|
unneeded_packages+=("$package")
|
||||||
done < <(echo "$package_list" | tail -n+$((table_start+2)))
|
done < <(echo "$package_list" | tail -n+$((table_start+2)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue