From e3e85cf38e5d435c97ca3fd66957b9f3c63b59e7 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 10 Aug 2022 13:57:50 -0600 Subject: [PATCH] pod_id regex --- functions/cmd_to_container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/cmd_to_container.sh b/functions/cmd_to_container.sh index ef378b14..173aaca7 100644 --- a/functions/cmd_to_container.sh +++ b/functions/cmd_to_container.sh @@ -24,7 +24,7 @@ do done app_name=$(echo -e "$app_name" | grep ^"$selection)" | awk '{print $2}') search=$(k3s crictl ps -a -s running) -mapfile -t pod_id < <(echo "$search" | grep -E " $app_name([[:space:]]|-([-[:alnum:]])*[[:space:]])" | awk '{print $9}') +mapfile -t pod_id < <(echo "$search" | grep -E "[[:space:]]$app_name([[:space:]]|-([-[:alnum:]])*[[:space:]])" | awk '{print $9}') [[ "${#pod_id[@]}" == 0 ]] && echo -e "No containers available\nAre you sure the application in running?" && exit containers=$( for pod in "${pod_id[@]}"