diff --git a/functions/cmd_to_container.sh b/functions/cmd_to_container.sh index 66c606ce..0491dd3a 100644 --- a/functions/cmd_to_container.sh +++ b/functions/cmd_to_container.sh @@ -32,9 +32,9 @@ do # continue # fi printf '%s\0' "${containers[@]}" | grep -Fxqz -- "$(echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r ")" && continue - containers+=("$(echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r ")") + containers+="$(echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r ")" done -readarray -t containers <<<"${containers[@]}" +readarray -t containers <<<"$containers" case "${#containers[@]}" in 0) echo -e "No containers available\nAre you sure the application in running?"