ShellCheck - shell script analysis tool version: 0.11.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.Hmd5pCyxH5 and /tmp/tmp.cUoAlLlEjV Tree base: 5262cb23393f ("Merge branch 'general-enhancements-to-rqspinlock-stress-test'") Now at: 7ccef7d292d5 ("tools: bpf: remove runqslower tool") ====== Checking before the patch ====== Checking tools/testing/selftests/bpf/test_bpftool_build.sh - 6a8e050bdece0a5d594bed4b51dc3874ad0d2e4395f482a2388a4591b7e870dc In test_bpftool_build.sh line 19: SCRIPT_REL_PATH=$(realpath --relative-to=$PWD $0) ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: SCRIPT_REL_PATH=$(realpath --relative-to="$PWD" "$0") In test_bpftool_build.sh line 20: SCRIPT_REL_DIR=$(dirname $SCRIPT_REL_PATH) ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: SCRIPT_REL_DIR=$(dirname "$SCRIPT_REL_PATH") In test_bpftool_build.sh line 21: KDIR_ROOT_DIR=$(realpath $PWD/$SCRIPT_REL_DIR/../../../../) ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: KDIR_ROOT_DIR=$(realpath "$PWD"/"$SCRIPT_REL_DIR"/../../../../) In test_bpftool_build.sh line 22: cd $KDIR_ROOT_DIR ^---------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cd "$KDIR_ROOT_DIR" || exit In test_bpftool_build.sh line 34: rm -rf -- $TMPDIR ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf -- "$TMPDIR" In test_bpftool_build.sh line 41: local dir=$(realpath $1) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local dir=$(realpath "$1") In test_bpftool_build.sh line 45: find $dir -type f -executable -name bpftool -print -exec false {} + && \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: find "$dir" -type f -executable -name bpftool -print -exec false {} + && \ In test_bpftool_build.sh line 52: make $J -s $* >/dev/null ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2048 (warning): Use "$@" (with quotes) to prevent whitespace problems. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make "$J" -s "$*" >/dev/null In test_bpftool_build.sh line 53: if [ $? -ne 0 ] ; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_bpftool_build.sh line 57: check ${@: -1} ^------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In test_bpftool_build.sh line 63: cd ${@: -1} ^---------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. Did you mean: cd ${@: -1} || exit In test_bpftool_build.sh line 75: ARGS=${@:1:(($# - 1))} ^---------------^ SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. In test_bpftool_build.sh line 78: echo -e "command: make -s $ARGS ${@: -1}=$TMPDIR/ >/dev/null" ^------^ SC2145 (error): Argument mixes string and array. Use * or separate argument. In test_bpftool_build.sh line 79: make $J -s $ARGS ${@: -1}=$TMPDIR/ >/dev/null ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. ^------^ SC2145 (error): Argument mixes string and array. Use * or separate argument. ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make "$J" -s "$ARGS" ${@: -1}="$TMPDIR"/ >/dev/null In test_bpftool_build.sh line 80: if [ $? -ne 0 ] ; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_bpftool_build.sh line 83: check $TMPDIR ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check "$TMPDIR" In test_bpftool_build.sh line 84: rm -rf -- $TMPDIR ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf -- "$TMPDIR" In test_bpftool_build.sh line 96: make -C tools/bpf/runqslower OUTPUT=${KDIR_ROOT_DIR}/tools/bpf/runqslower/ clean ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make -C tools/bpf/runqslower OUTPUT="${KDIR_ROOT_DIR}"/tools/bpf/runqslower/ clean In test_bpftool_build.sh line 120: cd tools/ ^-------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd tools/ || exit In test_bpftool_build.sh line 145: cd bpf/bpftool ^------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd bpf/bpftool || exit For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ... https://www.shellcheck.net/wiki/SC2048 -- Use "$@" (with quotes) to prevent... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/bpf/test_bpftool_build.sh - 6a8e050bdece0a5d594bed4b51dc3874ad0d2e4395f482a2388a4591b7e870dc In test_bpftool_build.sh line 19: SCRIPT_REL_PATH=$(realpath --relative-to=$PWD $0) ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: SCRIPT_REL_PATH=$(realpath --relative-to="$PWD" "$0") In test_bpftool_build.sh line 20: SCRIPT_REL_DIR=$(dirname $SCRIPT_REL_PATH) ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: SCRIPT_REL_DIR=$(dirname "$SCRIPT_REL_PATH") In test_bpftool_build.sh line 21: KDIR_ROOT_DIR=$(realpath $PWD/$SCRIPT_REL_DIR/../../../../) ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: KDIR_ROOT_DIR=$(realpath "$PWD"/"$SCRIPT_REL_DIR"/../../../../) In test_bpftool_build.sh line 22: cd $KDIR_ROOT_DIR ^---------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cd "$KDIR_ROOT_DIR" || exit In test_bpftool_build.sh line 34: rm -rf -- $TMPDIR ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf -- "$TMPDIR" In test_bpftool_build.sh line 41: local dir=$(realpath $1) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local dir=$(realpath "$1") In test_bpftool_build.sh line 45: find $dir -type f -executable -name bpftool -print -exec false {} + && \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: find "$dir" -type f -executable -name bpftool -print -exec false {} + && \ In test_bpftool_build.sh line 52: make $J -s $* >/dev/null ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2048 (warning): Use "$@" (with quotes) to prevent whitespace problems. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make "$J" -s "$*" >/dev/null In test_bpftool_build.sh line 53: if [ $? -ne 0 ] ; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_bpftool_build.sh line 57: check ${@: -1} ^------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In test_bpftool_build.sh line 63: cd ${@: -1} ^---------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. Did you mean: cd ${@: -1} || exit In test_bpftool_build.sh line 75: ARGS=${@:1:(($# - 1))} ^---------------^ SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. In test_bpftool_build.sh line 78: echo -e "command: make -s $ARGS ${@: -1}=$TMPDIR/ >/dev/null" ^------^ SC2145 (error): Argument mixes string and array. Use * or separate argument. In test_bpftool_build.sh line 79: make $J -s $ARGS ${@: -1}=$TMPDIR/ >/dev/null ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. ^------^ SC2145 (error): Argument mixes string and array. Use * or separate argument. ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make "$J" -s "$ARGS" ${@: -1}="$TMPDIR"/ >/dev/null In test_bpftool_build.sh line 80: if [ $? -ne 0 ] ; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_bpftool_build.sh line 83: check $TMPDIR ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check "$TMPDIR" In test_bpftool_build.sh line 84: rm -rf -- $TMPDIR ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf -- "$TMPDIR" In test_bpftool_build.sh line 116: cd tools/ ^-------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd tools/ || exit In test_bpftool_build.sh line 141: cd bpf/bpftool ^------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd bpf/bpftool || exit For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ... https://www.shellcheck.net/wiki/SC2048 -- Use "$@" (with quotes) to prevent...