Add ShellCheck's --enable=all inside scripts/

Strengthen static code analysis for shell scripts.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #12914
This commit is contained in:
Damian Szuberski
2022-01-13 19:09:19 +01:00
committed by GitHub
parent 8a7c4efd3c
commit 836136961a
10 changed files with 105 additions and 81 deletions
+7 -5
View File
@@ -102,10 +102,12 @@ function core_file
function core_prog
{
# shellcheck disable=SC2154
prog=$ZTEST
core_id=$($GDB --batch -c "$1" | grep "Core was generated by" | \
tr \' ' ')
if [[ "$core_id" == *"zdb "* ]]; then
# shellcheck disable=SC2154
prog=$ZDB
fi
printf "%s" "$prog"
@@ -130,7 +132,7 @@ function store_core
or_die mkdir -p "$dest/vdev"
if [[ $symlink -ne 0 ]]; then
or_die ln -sf "$dest" ztest.core.$foundcrashes
or_die ln -sf "$dest" "ztest.core.${foundcrashes}"
fi
echo "*** ztest crash found - moving logs to $dest"
@@ -195,10 +197,10 @@ while getopts ":ht:m:I:s:c:f:l" opt; do
case $opt in
t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
m ) [[ $OPTARG -gt 0 ]] && coremax=$OPTARG ;;
I ) [[ $OPTARG ]] && iterations=$OPTARG ;;
s ) [[ $OPTARG ]] && size=$OPTARG ;;
c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
f ) [[ $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
I ) [[ -n $OPTARG ]] && iterations=$OPTARG ;;
s ) [[ -n $OPTARG ]] && size=$OPTARG ;;
c ) [[ -n $OPTARG ]] && coredir=$OPTARG ;;
f ) [[ -n $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
l ) symlink=1 ;;
h ) usage
exit 2