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.iRcfmvxSbl and /tmp/tmp.kxYzCnSanR Tree base: 7b4ac12cc929 ("openvswitch: Allocate struct ovs_pcpu_storage dynamically") Now at: c36c9f8bdc5c ("selftests: netdevsim: improve lib.sh include in peer.sh") ====== Checking before the patch ====== Checking tools/testing/selftests/drivers/net/netdevsim/peer.sh - 1d3e559a2c0b53206e4d7b16086cfc5ae4378b09ca1076b19b7db3e82f139658 In peer.sh line 37: ip link set $NSIM_DEV_1_NAME netns nssv ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set "$NSIM_DEV_1_NAME" netns nssv In peer.sh line 38: ip link set $NSIM_DEV_2_NAME netns nscl ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set "$NSIM_DEV_2_NAME" netns nscl In peer.sh line 40: ip netns exec nssv ip addr add '192.168.1.1/24' dev $NSIM_DEV_1_NAME ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nssv ip addr add '192.168.1.1/24' dev "$NSIM_DEV_1_NAME" In peer.sh line 41: ip netns exec nscl ip addr add '192.168.1.2/24' dev $NSIM_DEV_2_NAME ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nscl ip addr add '192.168.1.2/24' dev "$NSIM_DEV_2_NAME" In peer.sh line 43: ip netns exec nssv ip link set dev $NSIM_DEV_1_NAME up ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nssv ip link set dev "$NSIM_DEV_1_NAME" up In peer.sh line 44: ip netns exec nscl ip link set dev $NSIM_DEV_2_NAME up ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nscl ip link set dev "$NSIM_DEV_2_NAME" up In peer.sh line 68: setup_ns ^------^ SC2119 (info): Use setup_ns "$@" if function's $1 should mean script's $1. In peer.sh line 72: NSIM_DEV_1_IFIDX=$(ip netns exec nssv cat /sys/class/net/$NSIM_DEV_1_NAME/ifindex) ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NSIM_DEV_1_IFIDX=$(ip netns exec nssv cat /sys/class/net/"$NSIM_DEV_1_NAME"/ifindex) In peer.sh line 76: NSIM_DEV_2_IFIDX=$(ip netns exec nscl cat /sys/class/net/$NSIM_DEV_2_NAME/ifindex) ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NSIM_DEV_2_IFIDX=$(ip netns exec nscl cat /sys/class/net/"$NSIM_DEV_2_NAME"/ifindex) In peer.sh line 79: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 86: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 93: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 100: if [ $? -ne 0 ]; then ^-- 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 peer.sh line 109: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 118: ip netns exec nssv socat TCP-LISTEN:1234,fork $tmp_file & ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nssv socat TCP-LISTEN:1234,fork "$tmp_file" & In peer.sh line 126: count=$(cat $tmp_file | wc -c) ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: count=$(cat "$tmp_file" | wc -c) For more information: https://www.shellcheck.net/wiki/SC2320 -- This $? refers to echo/printf, no... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2119 -- Use setup_ns "$@" if function's $... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/drivers/net/netdevsim/peer.sh - 1d3e559a2c0b53206e4d7b16086cfc5ae4378b09ca1076b19b7db3e82f139658 In peer.sh line 4: lib_dir=$(dirname $0)/../../../net ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: lib_dir=$(dirname "$0")/../../../net In peer.sh line 5: source $lib_dir/lib.sh ^-------------^ SC1091 (info): Not following: ./lib.sh: openBinaryFile: does not exist (No such file or directory) ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: source "$lib_dir"/lib.sh In peer.sh line 38: ip link set $NSIM_DEV_1_NAME netns nssv ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set "$NSIM_DEV_1_NAME" netns nssv In peer.sh line 39: ip link set $NSIM_DEV_2_NAME netns nscl ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set "$NSIM_DEV_2_NAME" netns nscl In peer.sh line 41: ip netns exec nssv ip addr add '192.168.1.1/24' dev $NSIM_DEV_1_NAME ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nssv ip addr add '192.168.1.1/24' dev "$NSIM_DEV_1_NAME" In peer.sh line 42: ip netns exec nscl ip addr add '192.168.1.2/24' dev $NSIM_DEV_2_NAME ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nscl ip addr add '192.168.1.2/24' dev "$NSIM_DEV_2_NAME" In peer.sh line 44: ip netns exec nssv ip link set dev $NSIM_DEV_1_NAME up ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nssv ip link set dev "$NSIM_DEV_1_NAME" up In peer.sh line 45: ip netns exec nscl ip link set dev $NSIM_DEV_2_NAME up ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nscl ip link set dev "$NSIM_DEV_2_NAME" up In peer.sh line 73: NSIM_DEV_1_IFIDX=$(ip netns exec nssv cat /sys/class/net/$NSIM_DEV_1_NAME/ifindex) ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NSIM_DEV_1_IFIDX=$(ip netns exec nssv cat /sys/class/net/"$NSIM_DEV_1_NAME"/ifindex) In peer.sh line 77: NSIM_DEV_2_IFIDX=$(ip netns exec nscl cat /sys/class/net/$NSIM_DEV_2_NAME/ifindex) ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: NSIM_DEV_2_IFIDX=$(ip netns exec nscl cat /sys/class/net/"$NSIM_DEV_2_NAME"/ifindex) In peer.sh line 80: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 87: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 94: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 101: if [ $? -ne 0 ]; then ^-- 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 peer.sh line 110: if [ $? -eq 0 ]; then ^-- 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 peer.sh line 119: ip netns exec nssv socat TCP-LISTEN:1234,fork $tmp_file & ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec nssv socat TCP-LISTEN:1234,fork "$tmp_file" & In peer.sh line 127: count=$(cat $tmp_file | wc -c) ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: count=$(cat "$tmp_file" | wc -c) For more information: https://www.shellcheck.net/wiki/SC2320 -- This $? refers to echo/printf, no... https://www.shellcheck.net/wiki/SC1091 -- Not following: ./lib.sh: openBina... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...