ShellCheck - shell script analysis tool version: 0.10.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.6OmE2IaWhd and /tmp/tmp.TEjl8yZYNi Tree base: 2f2da3edef62 ("selftests: netfilter: conntrack_resize.sh: also use udpclash tool") Now at: de4c3466ded1 ("selftests: netfilter: nft_concat_range.sh: send packets to empty set") ====== Checking before the patch ====== Checking tools/testing/selftests/net/netfilter/nft_concat_range.sh - 9af70c1607bb45389b2152f3d374bb2b870aa13f5390f3ff007123fa4497b76a In nft_concat_range.sh line 1374: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1381: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1397: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1404: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1410: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1418: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1425: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1433: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1439: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1446: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1452: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1461: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1469: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1478: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1488: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1817: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " ${i} ${j} ${dport} "$((dport+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: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " "${i}" "${j}" "${dport}" "$((dport+1))") In nft_concat_range.sh line 1820: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d1" $((dport+1))) "before add" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d1" $((dport+1))) "before add" || return 1 In nft_concat_range.sh line 1824: maybe_send_match "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d" $dport) "after add" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------------^ SC2046 (warning): Quote this to prevent word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: maybe_send_match "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d" "$dport") "after add" || return 1 In nft_concat_range.sh line 1827: if [ $? -ne 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In nft_concat_range.sh line 1828: local got=$(nft "get element inet filter test { $elem }") ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In nft_concat_range.sh line 1833: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d1" $((dport+1))) "out-of-range" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d1" $((dport+1))) "out-of-range" || return 1 In nft_concat_range.sh line 1842: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " ${i} ${j} ${dport} "$((dport+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: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " "${i}" "${j}" "${dport}" "$((dport+1))") In nft_concat_range.sh line 1845: if [ $? -ne 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In nft_concat_range.sh line 1846: local got=$(nft "get element inet filter test { $elem }") ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In nft_concat_range.sh line 1851: maybe_send_match "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d" $dport) "recheck" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------------^ SC2046 (warning): Quote this to prevent word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: maybe_send_match "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d" "$dport") "recheck" || return 1 In nft_concat_range.sh line 1852: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d1" $((dport+1))) "recheck out-of-range" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d1" $((dport+1))) "recheck out-of-range" || return 1 In nft_concat_range.sh line 1863: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " ${i} ${j} ${dport} "$((dport+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: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " "${i}" "${j}" "${dport}" "$((dport+1))") In nft_concat_range.sh line 1870: if [ $? -eq 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In nft_concat_range.sh line 1875: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d" $dport) "match after deletion" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------------^ SC2046 (warning): Quote this to prevent word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d" "$dport") "match after deletion" || return 1 In nft_concat_range.sh line 1947: printf "%5ds%-30s" $((tnow-tthen)) ^---------^ SC2183 (warning): This format string has 2 variables, but is passed 1 argument. For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2183 -- This format string has 2 variable... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/netfilter/nft_concat_range.sh - 9af70c1607bb45389b2152f3d374bb2b870aa13f5390f3ff007123fa4497b76a In nft_concat_range.sh line 1377: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1384: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1400: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1407: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1413: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1421: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1428: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1436: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1442: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1449: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1455: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1464: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1472: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1481: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1491: [ $i -gt 1 ] && echo ", " ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "$i" -gt 1 ] && echo ", " In nft_concat_range.sh line 1820: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " ${i} ${j} ${dport} "$((dport+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: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " "${i}" "${j}" "${dport}" "$((dport+1))") In nft_concat_range.sh line 1823: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d1" $((dport+1))) "before add" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d1" $((dport+1))) "before add" || return 1 In nft_concat_range.sh line 1827: maybe_send_match "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d" $dport) "after add" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------------^ SC2046 (warning): Quote this to prevent word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: maybe_send_match "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d" "$dport") "after add" || return 1 In nft_concat_range.sh line 1830: if [ $? -ne 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In nft_concat_range.sh line 1831: local got=$(nft "get element inet filter test { $elem }") ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In nft_concat_range.sh line 1836: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d1" $((dport+1))) "out-of-range" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d1" $((dport+1))) "out-of-range" || return 1 In nft_concat_range.sh line 1845: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " ${i} ${j} ${dport} "$((dport+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: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " "${i}" "${j}" "${dport}" "$((dport+1))") In nft_concat_range.sh line 1848: if [ $? -ne 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In nft_concat_range.sh line 1849: local got=$(nft "get element inet filter test { $elem }") ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In nft_concat_range.sh line 1854: maybe_send_match "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d" $dport) "recheck" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------------^ SC2046 (warning): Quote this to prevent word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: maybe_send_match "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d" "$dport") "recheck" || return 1 In nft_concat_range.sh line 1855: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d1" $((dport+1))) "recheck out-of-range" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d1" $((dport+1))) "recheck out-of-range" || return 1 In nft_concat_range.sh line 1866: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " ${i} ${j} ${dport} "$((dport+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: elem=$(printf "10.%d.%d.0/24 . %d-%d0 . 6-17 " "${i}" "${j}" "${dport}" "$((dport+1))") In nft_concat_range.sh line 1873: if [ $? -eq 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. In nft_concat_range.sh line 1878: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" $i $j) $(printf "%d" $dport) "match after deletion" || return 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-- SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------------^ SC2046 (warning): Quote this to prevent word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: maybe_send_nomatch "$elem" $(printf "10.%d.%d.1" "$i" "$j") $(printf "%d" "$dport") "match after deletion" || return 1 In nft_concat_range.sh line 1950: printf "%5ds%-30s" $((tnow-tthen)) ^---------^ SC2183 (warning): This format string has 2 variables, but is passed 1 argument. For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2183 -- This format string has 2 variable...