From 22c8d5e423709d3e0935505e1bce515ad36bbb64 Mon Sep 17 00:00:00 2001 From: mag37 Date: Wed, 1 Feb 2023 19:41:56 +0100 Subject: [PATCH] added sort Alphabetical sorting of the container lists. --- dockcheck_docker-run_ver.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dockcheck_docker-run_ver.sh b/dockcheck_docker-run_ver.sh index 39ecd80..791e551 100644 --- a/dockcheck_docker-run_ver.sh +++ b/dockcheck_docker-run_ver.sh @@ -1,5 +1,5 @@ #!/bin/bash -### VERSION v.0.1.0 +### VERSION v.0.1.1 ### DOCKER RUN - VERSION @@ -105,6 +105,12 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do fi done +### Sort arrays alphabetically +IFS=$'\n' +NoUpdates=($(sort <<<"${NoUpdates[*]}")) +GotUpdates=($(sort <<<"${GotUpdates[*]}")) +GotErrors=($(sort <<<"${GotErrors[*]}")) +unset IFS ### Create new Array to use for the numbered list: NumberedUpdates=(ALL "${GotUpdates[@]}")