From 445e653d220ad658c58a4135cafc3d8407f88810 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 28 Jan 2026 02:20:09 +0200 Subject: [PATCH] Read arrays cleanly --- .local/bin/clear-buildah | 7 ++++--- .local/bin/temper | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.local/bin/clear-buildah b/.local/bin/clear-buildah index 591aebd..5492177 100755 --- a/.local/bin/clear-buildah +++ b/.local/bin/clear-buildah @@ -3,9 +3,10 @@ set -euo pipefail IFS=$'\n\t' -buildah_containers="$(buildah list | tail --lines +2 | cut --delimiter ' ' --fields 1)" -if [ -z "${buildah_containers}" ]; then +containers_raw="$(buildah list | tail --lines +2 | cut --delimiter ' ' --fields 1)" +if [ -z "${containers_raw}" ]; then echo "No containers to remove" else - buildah rm "${buildah_containers}" + readarray -t containers <<< "${containers_raw}" + buildah rm "${containers[@]}" fi diff --git a/.local/bin/temper b/.local/bin/temper index 2fb087f..25eb8c2 100755 --- a/.local/bin/temper +++ b/.local/bin/temper @@ -63,7 +63,7 @@ fi editor_cmd="$(default_editor)" echo "Editing using the command \"${editor_cmd}\"" -IFS=' ' read -r -a editor <<< "${editor_cmd}" +IFS=' ' readarray -t editor <<< "${editor_cmd}" orig_file="$1" tempfile="$(mktemp)"