s4:script: Fix shellcheck errors in find_unused_options.sh
authorAndreas Schneider <asn@samba.org>
Fri, 10 Jun 2022 11:07:49 +0000 (13:07 +0200)
committerPavel Filipensky <pfilipensky@samba.org>
Mon, 22 Aug 2022 14:20:36 +0000 (14:20 +0000)
source4/script/find_unused_options.sh:20:16: error: Use braces when
expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). [SC1087]

source4/script/find_unused_options.sh:30:16: error: Use braces when
expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). [SC1087]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
source4/script/find_unused_options.sh

index 36e97710488f765a58a912f4fd8b137e8c8a4d08..ad56fabed26c85ec8dd0cd2d205e030cb8ac9d64 100755 (executable)
@@ -17,7 +17,7 @@ for i in $LIST_GLOBAL; do
        key=$(echo $i | cut -d ':' -f1)
        val=$(echo $i | cut -d ':' -f2)
 
-       found=$(grep "$key[ ]*()" $CFILES)
+       found=$(grep "${key}[ ]*()" $CFILES)
        if test -z "$found"; then
                echo "Not Used Global: $key() -> $val"
        fi
@@ -27,7 +27,7 @@ for i in $LIST_LOCAL; do
        key=$(echo $i | cut -d ':' -f1)
        val=$(echo $i | cut -d ':' -f2)
 
-       found=$(grep "$key[ ]*(" $CFILES)
+       found=$(grep "${key}[ ]*(" $CFILES)
 
        if test -z "$found"; then
                echo "Not Used LOCAL: $key() -> $val"