From b0c036069488bbdd36cc379c51fb76ce5b11a9d6 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 5 Sep 2018 20:24:03 +0100 Subject: [PATCH] updated check_bash_arrays.sh --- check_bash_arrays.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_bash_arrays.sh b/check_bash_arrays.sh index 6bcbd9b0..1702f754 100755 --- a/check_bash_arrays.sh +++ b/check_bash_arrays.sh @@ -36,7 +36,7 @@ check_bash_arrays(){ local filename="$1" echo -n "checking bash arrays: $1" set +eo pipefail - dups="$(grep -o '[[:alnum:]]\+[[[:digit:]]\+]=' "$filename" | sort | uniq -d)" + dups="$(grep -o '^[[:space:]]*[[:alnum:]]\+[[[:digit:]]\+]=' "$filename" | sed 's/[[:space:]]*//' | sort | uniq -d)" early_equals="$(grep -o '[[:alnum:]]\+=[[[:digit:]]\+]=' "$filename")" set -eo pipefail if [ -n "$dups" ]; then