You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a snippet or screenshot that shows the problem:
#!/usr/bin/env bashdemo() {
echo"in function demo..."echo"the script name: $0"echo"argument count (not include the script itself): $#"echo"the first argument: $1"echo"the second argument: $2"echo"the 10th argument: ${10}"# shellcheck disable=SC2145echo"argument list: $@"# echo 输出字符串,这里 shellcheck 会告警,字符串形式用 $* 就不会告警echo"argument list string: $*"echo"process id: $$"
ret=$?echo"command exited with ${ret}"if [[ ${ret}-ne 0 ]];thenecho"failed"fi
}
demo 1 2 3
Here's what shellcheck currently says:
In ./docs/test.sh line 16:
ret=$?
^-- SC2320 (warning): This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
Here's what I wanted or expected to see:
no SC2320 warning.
The text was updated successfully, but these errors were encountered:
For bugs
shellcheck --version
or "online"): 0.10.0For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
In ./docs/test.sh line 16:
ret=$?
^-- SC2320 (warning): This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten.
Here's what I wanted or expected to see:
no SC2320 warning.
The text was updated successfully, but these errors were encountered: