From bc694852a9709826821fb3220ba4949ffd6f7774 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 10 Aug 2022 17:00:10 -0600 Subject: [PATCH] expand all for grep --- functions/cmd_to_container.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/cmd_to_container.sh b/functions/cmd_to_container.sh index 8c68f768..d8eee929 100644 --- a/functions/cmd_to_container.sh +++ b/functions/cmd_to_container.sh @@ -55,7 +55,7 @@ else if [[ $selection == 0 ]]; then echo "Exiting.." exit - elif ! echo -e "$containers" | grep -qs ^"$selection)" ; then + elif ! echo -e "${containers[*]}" | grep -qs ^"$selection)" ; then echo "Error: \"$selection\" was not an option.. Try again" sleep 3 continue @@ -63,7 +63,7 @@ else break fi done - container=$(echo "$containers" | grep ^"$selection)" | awk '{print $2}') + container=$(echo "${containers[*]}" | grep ^"$selection)" | awk '{print $2}') container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}') fi while true