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.SHdGV7nY8A and /tmp/tmp.QqNJU9VNhv Tree base: cf4bfbb48a75 ("cgroup/cpuset: Prevent offline_disabled CPUs from being used in isolated partition") Now at: 84fc78721fe6 ("cgroup/cpuset: Documentation and kselftest updates") ====== Checking before the patch ====== Checking tools/testing/selftests/cgroup/test_cpuset_prs.sh - 80b9b38a5c62d9519aee6d819f34fe32dbfe770df5d53c952277e97aeab33994 In test_cpuset_prs.sh line 20: WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify ^--------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^-----------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: WAIT_INOTIFY=$(cd $(dirname "$0") || exit; pwd)/wait_inotify In test_cpuset_prs.sh line 25: SUBPARTS_CPUS=$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions ^-----------^ SC2034 (warning): SUBPARTS_CPUS appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 26: CPULIST=$(cat $CGROUP2/cpuset.cpus.effective) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: CPULIST=$(cat "$CGROUP2"/cpuset.cpus.effective) In test_cpuset_prs.sh line 70: cd $CGROUP2 ^---------^ 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 "$CGROUP2" || exit In test_cpuset_prs.sh line 98: BOOT_ISOLCPUS=$(cat $CGROUP2/cpuset.cpus.isolated) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: BOOT_ISOLCPUS=$(cat "$CGROUP2"/cpuset.cpus.isolated) In test_cpuset_prs.sh line 101: BOOT_ISOLCPUS=$(cat $CGROUP2/cpuset.cpus.isolated) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: BOOT_ISOLCPUS=$(cat "$CGROUP2"/cpuset.cpus.isolated) In test_cpuset_prs.sh line 105: [[ $(echo $BOOT_ISOLCPUS | sed -e "s/[,-].*//") -le 8 ]] && ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ $(echo "$BOOT_ISOLCPUS" | sed -e "s/[,-].*//") -le 8 ]] && In test_cpuset_prs.sh line 113: cd $CGROUP2 ^---------^ 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 "$CGROUP2" || exit In test_cpuset_prs.sh line 128: sleep $DELAY ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sleep "$DELAY" In test_cpuset_prs.sh line 146: echo $EXPECTED_VAL > cpuset.cpus.partition ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$EXPECTED_VAL" > cpuset.cpus.partition In test_cpuset_prs.sh line 147: [[ $? -eq 0 ]] || exit 1 ^-- SC2320 (warning): This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 149: [[ $ACTUAL_VAL != $EXPECTED_VAL ]] && { ^-----------^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 171: ERRMSG=$((echo $$ > cgroup.procs) |& cat) ^-- SC1102 (error): Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors. In test_cpuset_prs.sh line 172: echo $ERRMSG | grep -q "$OUTSTR" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$ERRMSG" | grep -q "$OUTSTR" In test_cpuset_prs.sh line 173: [[ $? -ne 0 ]] && { ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 178: echo $$ > $CGROUP2/cgroup.procs # Move out the task ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo $$ > "$CGROUP2"/cgroup.procs # Move out the task In test_cpuset_prs.sh line 212: TEST_MATRIX=( ^---------^ SC2034 (warning): TEST_MATRIX appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 464: REMOTE_TEST_MATRIX=( ^----------------^ SC2034 (warning): REMOTE_TEST_MATRIX appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 511: OFFLINE_CPUS=$(echo $CPU $CPU $OFFLINE_CPUS | fmt -1 |\ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: OFFLINE_CPUS=$(echo "$CPU" "$CPU" "$OFFLINE_CPUS" | fmt -1 |\ In test_cpuset_prs.sh line 515: echo $VAL > $CPUFILE ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$VAL" > "$CPUFILE" In test_cpuset_prs.sh line 539: for CMD in $(echo $STATE | sed -e "s/:/ /g") ^----------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for CMD in $(echo "$STATE" | sed -e "s/:/ /g") In test_cpuset_prs.sh line 549: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 555: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 560: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 564: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 580: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 583: write_cpu_online $VAL ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: write_cpu_online "$VAL" In test_cpuset_prs.sh line 586: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 610: [[ -d $CGRP ]] || mkdir $CGRP ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -d $CGRP ]] || mkdir "$CGRP" In test_cpuset_prs.sh line 611: set_ctrl_state $CGRP $STATE 1 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state "$CGRP" "$STATE" 1 In test_cpuset_prs.sh line 612: [[ $? -ne 0 ]] && { ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 620: [[ -n "OFFLINE_CPUS" ]] && { ^----------^ SC2157 (error): Argument to -n is always true due to literal strings. In test_cpuset_prs.sh line 623: write_cpu_online ${C}=1 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: write_cpu_online "${C}"=1 In test_cpuset_prs.sh line 633: echo 0 > $CGROUP2/cgroup.procs ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo 0 > "$CGROUP2"/cgroup.procs In test_cpuset_prs.sh line 635: rmdir $RESET_LIST > /dev/null 2>&1 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rmdir "$RESET_LIST" > /dev/null 2>&1 In test_cpuset_prs.sh line 649: [[ -e $CPUS ]] && echo "$CPUS: $(cat $CPUS)" ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $CPUS ]] && echo "$CPUS: $(cat "$CPUS")" In test_cpuset_prs.sh line 650: [[ -e $XCPUS ]] && echo "$XCPUS: $(cat $XCPUS)" ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $XCPUS ]] && echo "$XCPUS: $(cat "$XCPUS")" In test_cpuset_prs.sh line 651: [[ -e $ECPUS ]] && echo "$ECPUS: $(cat $ECPUS)" ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $ECPUS ]] && echo "$ECPUS: $(cat "$ECPUS")" In test_cpuset_prs.sh line 652: [[ -e $XECPUS ]] && echo "$XECPUS: $(cat $XECPUS)" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $XECPUS ]] && echo "$XECPUS: $(cat "$XECPUS")" In test_cpuset_prs.sh line 653: [[ -e $PRS ]] && echo "$PRS: $(cat $PRS)" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $PRS ]] && echo "$PRS: $(cat "$PRS")" In test_cpuset_prs.sh line 654: [[ -e $PCPUS ]] && echo "$PCPUS: $(cat $PCPUS)" ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $PCPUS ]] && echo "$PCPUS: $(cat "$PCPUS")" In test_cpuset_prs.sh line 655: [[ -e $ISCPUS ]] && echo "$ISCPUS: $(cat $ISCPUS)" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $ISCPUS ]] && echo "$ISCPUS: $(cat "$ISCPUS")" In test_cpuset_prs.sh line 681: for CHK in $(echo $CHK_STR | sed -e "s/|/ /g") ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for CHK in $(echo "$CHK_STR" | sed -e "s/|/ /g") In test_cpuset_prs.sh line 683: set -- $(echo $CHK | sed -e "s/:/ /g") ^-----------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^--------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set -- $(echo "$CHK" | sed -e "s/:/ /g") In test_cpuset_prs.sh line 694: set_cgroup_dir $CGRP ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_cgroup_dir "$CGRP" In test_cpuset_prs.sh line 696: ACTUAL_CPUS=$(cat $CGRP_DIR/$FILE) ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ACTUAL_CPUS=$(cat "$CGRP_DIR"/$FILE) In test_cpuset_prs.sh line 697: [[ $EXPECTED_CPUS = $ACTUAL_CPUS ]] || return 1 ^----------^ SC2053 (warning): Quote the right-hand side of = in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 708: for CHK in $(echo $CHK_STR | sed -e "s/|/ /g") ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for CHK in $(echo "$CHK_STR" | sed -e "s/|/ /g") In test_cpuset_prs.sh line 710: set -- $(echo $CHK | sed -e "s/:/ /g") ^-----------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^--------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set -- $(echo "$CHK" | sed -e "s/:/ /g") In test_cpuset_prs.sh line 714: EVAL=$(expr substr $EXPECTED_STATE 2 2) ^----^ SC2308 (info): 'expr substr' has unspecified results. Prefer 'cut' or ${var#???}. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: EVAL=$(expr substr "$EXPECTED_STATE" 2 2) In test_cpuset_prs.sh line 716: set_cgroup_dir $CGRP ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_cgroup_dir "$CGRP" In test_cpuset_prs.sh line 724: ACTUAL_STATE=$(cat $FILE) ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ACTUAL_STATE=$(cat "$FILE") In test_cpuset_prs.sh line 741: [[ $EVAL != $VAL ]] && return 1 ^--^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 748: DOMS=$(cat $CGRP_DIR/cpuset.cpus.effective) ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: DOMS=$(cat "$CGRP_DIR"/cpuset.cpus.effective) In test_cpuset_prs.sh line 775: ISOLCPUS=$(cat $ISCPUS) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ISOLCPUS=$(cat "$ISCPUS") In test_cpuset_prs.sh line 783: elif [[ $(expr $EXPECTED_ISOLCPUS : ".*|.*") > 0 ]] ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2071 (error): > is for string comparisons. Use -gt instead. Did you mean: elif [[ $(expr "$EXPECTED_ISOLCPUS" : ".*|.*") > 0 ]] In test_cpuset_prs.sh line 785: set -- $(echo $EXPECTED_ISOLCPUS | sed -e "s/|/ /g") ^-- SC2046 (warning): Quote this to prevent word splitting. ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set -- $(echo "$EXPECTED_ISOLCPUS" | sed -e "s/|/ /g") In test_cpuset_prs.sh line 808: ISOLCPUS=$(cat $ISCPUS) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ISOLCPUS=$(cat "$ISCPUS") In test_cpuset_prs.sh line 824: for ((CPU=0; CPU < $NR_CPUS; CPU++)) ^------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In test_cpuset_prs.sh line 835: if [[ $? -eq 0 ]] ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 859: echo "Test $TEST[$TESTNUM] failed $TESTTYPE check!" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 861: eval echo \${$TEST[$I]} ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it. ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it. Did you mean: eval echo \${"$TEST"[$I]} In test_cpuset_prs.sh line 880: [[ $? -eq 0 ]] && return 0 ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 903: check_effective_cpus $_ECPUS ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_effective_cpus "$_ECPUS" In test_cpuset_prs.sh line 904: [[ $? -ne 0 ]] && test_fail $_NR "effective CPU" \ ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ $? -ne 0 ]] && test_fail "$_NR" "effective CPU" \ In test_cpuset_prs.sh line 909: check_cgroup_states $_PSTATES ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_cgroup_states "$_PSTATES" In test_cpuset_prs.sh line 910: [[ $? -ne 0 ]] && test_fail $_NR states \ ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ $? -ne 0 ]] && test_fail "$_NR" states \ In test_cpuset_prs.sh line 917: check_isolcpus $_ISOLCPUS ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_isolcpus "$_ISOLCPUS" In test_cpuset_prs.sh line 918: [[ $? -ne 0 ]] && { ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 920: test_fail $_NR "isolated CPU" \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: test_fail "$_NR" "isolated CPU" \ In test_cpuset_prs.sh line 928: _NEWLIST=$(cat $CGROUP2/cpuset.cpus.effective) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: _NEWLIST=$(cat "$CGROUP2"/cpuset.cpus.effective) In test_cpuset_prs.sh line 930: while [[ $_NEWLIST != $CPULIST && $RETRY -lt 8 ]] ^------^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 935: _NEWLIST=$(cat $CGROUP2/cpuset.cpus.effective) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: _NEWLIST=$(cat "$CGROUP2"/cpuset.cpus.effective) In test_cpuset_prs.sh line 937: [[ $_NEWLIST != $CPULIST ]] && { ^------^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 959: eval CNT="\${#$TEST[@]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 969: eval echo \${$TEST[$I]} ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it. ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it. Did you mean: eval echo \${"$TEST"[$I]} In test_cpuset_prs.sh line 971: eval set -- "\${$TEST[$I]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 985: set_ctrl_state_noerr A1 $OLD_A1 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr A1 "$OLD_A1" In test_cpuset_prs.sh line 986: set_ctrl_state_noerr A1/A2 $OLD_A2 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr A1/A2 "$OLD_A2" In test_cpuset_prs.sh line 987: set_ctrl_state_noerr A1/A2/A3 $OLD_A3 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr A1/A2/A3 "$OLD_A3" In test_cpuset_prs.sh line 988: set_ctrl_state_noerr B1 $OLD_B1 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr B1 "$OLD_B1" In test_cpuset_prs.sh line 991: set_ctrl_state A1 $NEW_A1; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state A1 "$NEW_A1"; ((RETVAL += $?)) In test_cpuset_prs.sh line 992: set_ctrl_state A1/A2 $NEW_A2; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state A1/A2 "$NEW_A2"; ((RETVAL += $?)) In test_cpuset_prs.sh line 993: set_ctrl_state A1/A2/A3 $NEW_A3; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state A1/A2/A3 "$NEW_A3"; ((RETVAL += $?)) In test_cpuset_prs.sh line 994: set_ctrl_state B1 $NEW_B1; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state B1 "$NEW_B1"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1012: cd rtest ^------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd rtest || exit In test_cpuset_prs.sh line 1019: eval CNT="\${#$TEST[@]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 1029: eval echo \${$TEST[$I]} ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it. ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it. Did you mean: eval echo \${"$TEST"[$I]} In test_cpuset_prs.sh line 1031: eval set -- "\${$TEST[$I]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 1048: set_ctrl_state_noerr p1 $OLD_p1 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p1 "$OLD_p1" In test_cpuset_prs.sh line 1049: set_ctrl_state_noerr p2 $OLD_p2 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p2 "$OLD_p2" In test_cpuset_prs.sh line 1050: set_ctrl_state_noerr p1/c11 $OLD_c11 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p1/c11 "$OLD_c11" In test_cpuset_prs.sh line 1051: set_ctrl_state_noerr p1/c12 $OLD_c12 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p1/c12 "$OLD_c12" In test_cpuset_prs.sh line 1052: set_ctrl_state_noerr p2/c21 $OLD_c21 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p2/c21 "$OLD_c21" In test_cpuset_prs.sh line 1053: set_ctrl_state_noerr p2/c22 $OLD_c22 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p2/c22 "$OLD_c22" In test_cpuset_prs.sh line 1056: set_ctrl_state p1 $NEW_p1 ; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p1 "$NEW_p1" ; ((RETVAL += $?)) In test_cpuset_prs.sh line 1057: set_ctrl_state p2 $NEW_p2 ; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p2 "$NEW_p2" ; ((RETVAL += $?)) In test_cpuset_prs.sh line 1058: set_ctrl_state p1/c11 $NEW_c11; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p1/c11 "$NEW_c11"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1059: set_ctrl_state p1/c12 $NEW_c12; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p1/c12 "$NEW_c12"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1060: set_ctrl_state p2/c21 $NEW_c21; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p2/c21 "$NEW_c21"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1061: set_ctrl_state p2/c22 $NEW_c22; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p2/c22 "$NEW_c22"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1068: cd .. ^---^ SC2103 (info): Use a ( subshell ) to avoid having to cd back. In test_cpuset_prs.sh line 1078: cd $CGROUP2/test ^--------------^ 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 "$CGROUP2"/test || exit In test_cpuset_prs.sh line 1109: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1113: cd .. ^---^ SC2103 (info): Use a ( subshell ) to avoid having to cd back. In test_cpuset_prs.sh line 1118: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1123: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1127: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1134: echo $$ > $CGROUP2/cgroup.procs ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo $$ > "$CGROUP2"/cgroup.procs In test_cpuset_prs.sh line 1150: $WAIT_INOTIFY $CGROUP_FILE ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: $WAIT_INOTIFY "$CGROUP_FILE" In test_cpuset_prs.sh line 1151: cat $CGROUP_FILE > $OUTPUT_FILE ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cat "$CGROUP_FILE" > "$OUTPUT_FILE" In test_cpuset_prs.sh line 1162: cd $CGROUP2/test ^--------------^ 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 "$CGROUP2"/test || exit In test_cpuset_prs.sh line 1174: wait_inotify $PWD/cpuset.cpus.partition $PRS & ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_inotify "$PWD"/cpuset.cpus.partition $PRS & In test_cpuset_prs.sh line 1179: if [[ $? -ne 0 ]] ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. For more information: https://www.shellcheck.net/wiki/SC1087 -- Use braces when expanding arrays,... https://www.shellcheck.net/wiki/SC1102 -- Shells disambiguate $(( different... https://www.shellcheck.net/wiki/SC2071 -- > is for string comparisons. Use ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/cgroup/test_cpuset_prs.sh - 80b9b38a5c62d9519aee6d819f34fe32dbfe770df5d53c952277e97aeab33994 In test_cpuset_prs.sh line 20: WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify ^--------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^-----------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: WAIT_INOTIFY=$(cd $(dirname "$0") || exit; pwd)/wait_inotify In test_cpuset_prs.sh line 25: SUBPARTS_CPUS=$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions ^-----------^ SC2034 (warning): SUBPARTS_CPUS appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 26: CPULIST=$(cat $CGROUP2/cpuset.cpus.effective) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: CPULIST=$(cat "$CGROUP2"/cpuset.cpus.effective) In test_cpuset_prs.sh line 76: cd $CGROUP2 ^---------^ 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 "$CGROUP2" || exit In test_cpuset_prs.sh line 100: [[ "$BOOT_NOHZ_FULL" = nohz_full ]] && CHK_NOHZ_FULL=1 ^-----------^ SC2034 (warning): CHK_NOHZ_FULL appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 113: BOOT_ISOLCPUS=$(cat $CGROUP2/cpuset.cpus.isolated) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: BOOT_ISOLCPUS=$(cat "$CGROUP2"/cpuset.cpus.isolated) In test_cpuset_prs.sh line 116: BOOT_ISOLCPUS=$(cat $CGROUP2/cpuset.cpus.isolated) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: BOOT_ISOLCPUS=$(cat "$CGROUP2"/cpuset.cpus.isolated) In test_cpuset_prs.sh line 120: [[ $(echo $BOOT_ISOLCPUS | sed -e "s/[,-].*//") -le 8 ]] && ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ $(echo "$BOOT_ISOLCPUS" | sed -e "s/[,-].*//") -le 8 ]] && In test_cpuset_prs.sh line 128: cd $CGROUP2 ^---------^ 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 "$CGROUP2" || exit In test_cpuset_prs.sh line 143: sleep $DELAY ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: sleep "$DELAY" In test_cpuset_prs.sh line 161: echo $EXPECTED_VAL > cpuset.cpus.partition ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$EXPECTED_VAL" > cpuset.cpus.partition In test_cpuset_prs.sh line 162: [[ $? -eq 0 ]] || exit 1 ^-- SC2320 (warning): This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 164: [[ $ACTUAL_VAL != $EXPECTED_VAL ]] && { ^-----------^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 186: ERRMSG=$((echo $$ > cgroup.procs) |& cat) ^-- SC1102 (error): Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors. In test_cpuset_prs.sh line 187: echo $ERRMSG | grep -q "$OUTSTR" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$ERRMSG" | grep -q "$OUTSTR" In test_cpuset_prs.sh line 188: [[ $? -ne 0 ]] && { ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 193: echo $$ > $CGROUP2/cgroup.procs # Move out the task ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo $$ > "$CGROUP2"/cgroup.procs # Move out the task In test_cpuset_prs.sh line 227: TEST_MATRIX=( ^---------^ SC2034 (warning): TEST_MATRIX appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 464: CPU0_ISOLCPUS_MATRIX=( ^------------------^ SC2034 (warning): CPU0_ISOLCPUS_MATRIX appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 494: REMOTE_TEST_MATRIX=( ^----------------^ SC2034 (warning): REMOTE_TEST_MATRIX appears unused. Verify use (or export if used externally). In test_cpuset_prs.sh line 541: OFFLINE_CPUS=$(echo $CPU $CPU $OFFLINE_CPUS | fmt -1 |\ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: OFFLINE_CPUS=$(echo "$CPU" "$CPU" "$OFFLINE_CPUS" | fmt -1 |\ In test_cpuset_prs.sh line 545: echo $VAL > $CPUFILE ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$VAL" > "$CPUFILE" In test_cpuset_prs.sh line 569: for CMD in $(echo $STATE | sed -e "s/:/ /g") ^----------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for CMD in $(echo "$STATE" | sed -e "s/:/ /g") In test_cpuset_prs.sh line 579: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 585: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 590: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 594: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 610: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 613: write_cpu_online $VAL ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: write_cpu_online "$VAL" In test_cpuset_prs.sh line 616: eval $COMM $REDIRECT ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: eval "$COMM" "$REDIRECT" In test_cpuset_prs.sh line 640: [[ -d $CGRP ]] || mkdir $CGRP ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -d $CGRP ]] || mkdir "$CGRP" In test_cpuset_prs.sh line 641: set_ctrl_state $CGRP $STATE 1 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state "$CGRP" "$STATE" 1 In test_cpuset_prs.sh line 642: [[ $? -ne 0 ]] && { ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 650: [[ -n "OFFLINE_CPUS" ]] && { ^----------^ SC2157 (error): Argument to -n is always true due to literal strings. In test_cpuset_prs.sh line 653: write_cpu_online ${C}=1 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: write_cpu_online "${C}"=1 In test_cpuset_prs.sh line 663: echo 0 > $CGROUP2/cgroup.procs ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo 0 > "$CGROUP2"/cgroup.procs In test_cpuset_prs.sh line 665: rmdir $RESET_LIST > /dev/null 2>&1 ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rmdir "$RESET_LIST" > /dev/null 2>&1 In test_cpuset_prs.sh line 679: [[ -e $CPUS ]] && echo "$CPUS: $(cat $CPUS)" ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $CPUS ]] && echo "$CPUS: $(cat "$CPUS")" In test_cpuset_prs.sh line 680: [[ -e $XCPUS ]] && echo "$XCPUS: $(cat $XCPUS)" ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $XCPUS ]] && echo "$XCPUS: $(cat "$XCPUS")" In test_cpuset_prs.sh line 681: [[ -e $ECPUS ]] && echo "$ECPUS: $(cat $ECPUS)" ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $ECPUS ]] && echo "$ECPUS: $(cat "$ECPUS")" In test_cpuset_prs.sh line 682: [[ -e $XECPUS ]] && echo "$XECPUS: $(cat $XECPUS)" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $XECPUS ]] && echo "$XECPUS: $(cat "$XECPUS")" In test_cpuset_prs.sh line 683: [[ -e $PRS ]] && echo "$PRS: $(cat $PRS)" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $PRS ]] && echo "$PRS: $(cat "$PRS")" In test_cpuset_prs.sh line 684: [[ -e $PCPUS ]] && echo "$PCPUS: $(cat $PCPUS)" ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $PCPUS ]] && echo "$PCPUS: $(cat "$PCPUS")" In test_cpuset_prs.sh line 685: [[ -e $ISCPUS ]] && echo "$ISCPUS: $(cat $ISCPUS)" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ -e $ISCPUS ]] && echo "$ISCPUS: $(cat "$ISCPUS")" In test_cpuset_prs.sh line 713: for CHK in $(echo $CHK_STR | sed -e "s/|/ /g") ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for CHK in $(echo "$CHK_STR" | sed -e "s/|/ /g") In test_cpuset_prs.sh line 715: set -- $(echo $CHK | sed -e "s/:/ /g") ^-----------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^--------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set -- $(echo "$CHK" | sed -e "s/:/ /g") In test_cpuset_prs.sh line 726: set_cgroup_dir $CGRP ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_cgroup_dir "$CGRP" In test_cpuset_prs.sh line 728: ACTUAL_CPUS=$(cat $CGRP_DIR/$FILE) ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ACTUAL_CPUS=$(cat "$CGRP_DIR"/$FILE) In test_cpuset_prs.sh line 729: [[ $EXPECTED_CPUS = $ACTUAL_CPUS ]] || return 1 ^----------^ SC2053 (warning): Quote the right-hand side of = in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 740: for CHK in $(echo $CHK_STR | sed -e "s/|/ /g") ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: for CHK in $(echo "$CHK_STR" | sed -e "s/|/ /g") In test_cpuset_prs.sh line 742: set -- $(echo $CHK | sed -e "s/:/ /g") ^-----------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^--------------------------^ SC2001 (style): See if you can use ${variable//search/replace} instead. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set -- $(echo "$CHK" | sed -e "s/:/ /g") In test_cpuset_prs.sh line 746: EVAL=$(expr substr $EXPECTED_STATE 2 2) ^----^ SC2308 (info): 'expr substr' has unspecified results. Prefer 'cut' or ${var#???}. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: EVAL=$(expr substr "$EXPECTED_STATE" 2 2) In test_cpuset_prs.sh line 748: set_cgroup_dir $CGRP ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_cgroup_dir "$CGRP" In test_cpuset_prs.sh line 756: ACTUAL_STATE=$(cat $FILE) ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ACTUAL_STATE=$(cat "$FILE") In test_cpuset_prs.sh line 773: [[ $EVAL != $VAL ]] && return 1 ^--^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 780: DOMS=$(cat $CGRP_DIR/cpuset.cpus.effective) ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: DOMS=$(cat "$CGRP_DIR"/cpuset.cpus.effective) In test_cpuset_prs.sh line 807: ISOLCPUS=$(cat $ISCPUS) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ISOLCPUS=$(cat "$ISCPUS") In test_cpuset_prs.sh line 815: elif [[ $(expr $EXPECTED_ISOLCPUS : ".*|.*") > 0 ]] ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2071 (error): > is for string comparisons. Use -gt instead. Did you mean: elif [[ $(expr "$EXPECTED_ISOLCPUS" : ".*|.*") > 0 ]] In test_cpuset_prs.sh line 817: set -- $(echo $EXPECTED_ISOLCPUS | sed -e "s/|/ /g") ^-- SC2046 (warning): Quote this to prevent word splitting. ^-- SC2001 (style): See if you can use ${variable//search/replace} instead. ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set -- $(echo "$EXPECTED_ISOLCPUS" | sed -e "s/|/ /g") In test_cpuset_prs.sh line 852: ISOLCPUS=$(cat $ISCPUS) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ISOLCPUS=$(cat "$ISCPUS") In test_cpuset_prs.sh line 868: for ((CPU=0; CPU < $NR_CPUS; CPU++)) ^------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In test_cpuset_prs.sh line 879: if [[ $? -eq 0 ]] ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 903: echo "Test $TEST[$TESTNUM] failed $TESTTYPE check!" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 905: eval echo \${$TEST[$I]} ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it. ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it. Did you mean: eval echo \${"$TEST"[$I]} In test_cpuset_prs.sh line 924: [[ $? -eq 0 ]] && return 0 ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 947: check_effective_cpus $_ECPUS ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_effective_cpus "$_ECPUS" In test_cpuset_prs.sh line 948: [[ $? -ne 0 ]] && test_fail $_NR "effective CPU" \ ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ $? -ne 0 ]] && test_fail "$_NR" "effective CPU" \ In test_cpuset_prs.sh line 953: check_cgroup_states $_PSTATES ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_cgroup_states "$_PSTATES" In test_cpuset_prs.sh line 954: [[ $? -ne 0 ]] && test_fail $_NR states \ ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [[ $? -ne 0 ]] && test_fail "$_NR" states \ In test_cpuset_prs.sh line 961: check_isolcpus $_ISOLCPUS ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_isolcpus "$_ISOLCPUS" In test_cpuset_prs.sh line 962: [[ $? -ne 0 ]] && { ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 964: test_fail $_NR "isolated CPU" \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: test_fail "$_NR" "isolated CPU" \ In test_cpuset_prs.sh line 972: _NEWLIST=$(cat $CGROUP2/cpuset.cpus.effective) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: _NEWLIST=$(cat "$CGROUP2"/cpuset.cpus.effective) In test_cpuset_prs.sh line 974: while [[ $_NEWLIST != $CPULIST && $RETRY -lt 8 ]] ^------^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 979: _NEWLIST=$(cat $CGROUP2/cpuset.cpus.effective) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: _NEWLIST=$(cat "$CGROUP2"/cpuset.cpus.effective) In test_cpuset_prs.sh line 981: [[ $_NEWLIST != $CPULIST ]] && { ^------^ SC2053 (warning): Quote the right-hand side of != in [[ ]] to prevent glob matching. In test_cpuset_prs.sh line 1003: eval CNT="\${#$TEST[@]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 1013: eval echo \${$TEST[$I]} ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it. ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it. Did you mean: eval echo \${"$TEST"[$I]} In test_cpuset_prs.sh line 1015: eval set -- "\${$TEST[$I]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 1029: set_ctrl_state_noerr A1 $OLD_A1 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr A1 "$OLD_A1" In test_cpuset_prs.sh line 1030: set_ctrl_state_noerr A1/A2 $OLD_A2 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr A1/A2 "$OLD_A2" In test_cpuset_prs.sh line 1031: set_ctrl_state_noerr A1/A2/A3 $OLD_A3 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr A1/A2/A3 "$OLD_A3" In test_cpuset_prs.sh line 1032: set_ctrl_state_noerr B1 $OLD_B1 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr B1 "$OLD_B1" In test_cpuset_prs.sh line 1035: set_ctrl_state A1 $NEW_A1; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state A1 "$NEW_A1"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1036: set_ctrl_state A1/A2 $NEW_A2; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state A1/A2 "$NEW_A2"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1037: set_ctrl_state A1/A2/A3 $NEW_A3; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state A1/A2/A3 "$NEW_A3"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1038: set_ctrl_state B1 $NEW_B1; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state B1 "$NEW_B1"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1056: cd rtest ^------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd rtest || exit In test_cpuset_prs.sh line 1063: eval CNT="\${#$TEST[@]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 1073: eval echo \${$TEST[$I]} ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it. ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it. Did you mean: eval echo \${"$TEST"[$I]} In test_cpuset_prs.sh line 1075: eval set -- "\${$TEST[$I]}" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). In test_cpuset_prs.sh line 1092: set_ctrl_state_noerr p1 $OLD_p1 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p1 "$OLD_p1" In test_cpuset_prs.sh line 1093: set_ctrl_state_noerr p2 $OLD_p2 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p2 "$OLD_p2" In test_cpuset_prs.sh line 1094: set_ctrl_state_noerr p1/c11 $OLD_c11 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p1/c11 "$OLD_c11" In test_cpuset_prs.sh line 1095: set_ctrl_state_noerr p1/c12 $OLD_c12 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p1/c12 "$OLD_c12" In test_cpuset_prs.sh line 1096: set_ctrl_state_noerr p2/c21 $OLD_c21 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p2/c21 "$OLD_c21" In test_cpuset_prs.sh line 1097: set_ctrl_state_noerr p2/c22 $OLD_c22 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state_noerr p2/c22 "$OLD_c22" In test_cpuset_prs.sh line 1100: set_ctrl_state p1 $NEW_p1 ; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p1 "$NEW_p1" ; ((RETVAL += $?)) In test_cpuset_prs.sh line 1101: set_ctrl_state p2 $NEW_p2 ; ((RETVAL += $?)) ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p2 "$NEW_p2" ; ((RETVAL += $?)) In test_cpuset_prs.sh line 1102: set_ctrl_state p1/c11 $NEW_c11; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p1/c11 "$NEW_c11"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1103: set_ctrl_state p1/c12 $NEW_c12; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p1/c12 "$NEW_c12"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1104: set_ctrl_state p2/c21 $NEW_c21; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p2/c21 "$NEW_c21"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1105: set_ctrl_state p2/c22 $NEW_c22; ((RETVAL += $?)) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: set_ctrl_state p2/c22 "$NEW_c22"; ((RETVAL += $?)) In test_cpuset_prs.sh line 1112: cd .. ^---^ SC2103 (info): Use a ( subshell ) to avoid having to cd back. In test_cpuset_prs.sh line 1127: [[ $? -ne 0 ]] && return ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In test_cpuset_prs.sh line 1137: cd $CGROUP2/test ^--------------^ 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 "$CGROUP2"/test || exit In test_cpuset_prs.sh line 1168: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1172: cd .. ^---^ SC2103 (info): Use a ( subshell ) to avoid having to cd back. In test_cpuset_prs.sh line 1177: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1182: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1186: cd A1 ^---^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd A1 || exit In test_cpuset_prs.sh line 1193: echo $$ > $CGROUP2/cgroup.procs ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo $$ > "$CGROUP2"/cgroup.procs In test_cpuset_prs.sh line 1209: $WAIT_INOTIFY $CGROUP_FILE ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: $WAIT_INOTIFY "$CGROUP_FILE" In test_cpuset_prs.sh line 1210: cat $CGROUP_FILE > $OUTPUT_FILE ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cat "$CGROUP_FILE" > "$OUTPUT_FILE" In test_cpuset_prs.sh line 1221: cd $CGROUP2/test ^--------------^ 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 "$CGROUP2"/test || exit In test_cpuset_prs.sh line 1233: wait_inotify $PWD/cpuset.cpus.partition $PRS & ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_inotify "$PWD"/cpuset.cpus.partition $PRS & In test_cpuset_prs.sh line 1238: if [[ $? -ne 0 ]] ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. For more information: https://www.shellcheck.net/wiki/SC1087 -- Use braces when expanding arrays,... https://www.shellcheck.net/wiki/SC1102 -- Shells disambiguate $(( different... https://www.shellcheck.net/wiki/SC2071 -- > is for string comparisons. Use ...