Read arrays cleanly
This commit is contained in:
parent
aa92f5c88a
commit
445e653d22
2 changed files with 5 additions and 4 deletions
|
|
@ -3,9 +3,10 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
buildah_containers="$(buildah list | tail --lines +2 | cut --delimiter ' ' --fields 1)"
|
containers_raw="$(buildah list | tail --lines +2 | cut --delimiter ' ' --fields 1)"
|
||||||
if [ -z "${buildah_containers}" ]; then
|
if [ -z "${containers_raw}" ]; then
|
||||||
echo "No containers to remove"
|
echo "No containers to remove"
|
||||||
else
|
else
|
||||||
buildah rm "${buildah_containers}"
|
readarray -t containers <<< "${containers_raw}"
|
||||||
|
buildah rm "${containers[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ fi
|
||||||
editor_cmd="$(default_editor)"
|
editor_cmd="$(default_editor)"
|
||||||
echo "Editing using the command \"${editor_cmd}\""
|
echo "Editing using the command \"${editor_cmd}\""
|
||||||
|
|
||||||
IFS=' ' read -r -a editor <<< "${editor_cmd}"
|
IFS=' ' readarray -t editor <<< "${editor_cmd}"
|
||||||
|
|
||||||
orig_file="$1"
|
orig_file="$1"
|
||||||
tempfile="$(mktemp)"
|
tempfile="$(mktemp)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue