From ffd0d1aaeb90f5a2e9baf61d5a8565fcf0a06a4e Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sun, 21 Aug 2022 22:32:38 -0600 Subject: [PATCH] sort and clean --- functions/cmd_to_container.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/cmd_to_container.sh b/functions/cmd_to_container.sh index dbb7d76b..b8724a66 100644 --- a/functions/cmd_to_container.sh +++ b/functions/cmd_to_container.sh @@ -35,7 +35,8 @@ do # printf '%s\0' "${containers[@]}" | grep -Fxqz -- "$(echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r ")" && continue echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r " >> cont_file done -mapfile -t containers < "$(sort -u cont_file)" +clean_list=$(sort -u cont_file) +mapfile -t containers < "$clean_list" rm cont_file 2> /dev/null case "${#containers[@]}" in 0)