We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Syntax error in redirection is not identified.
$ cat hello.sh #!/bin/bash shopt -s expand_aliases alias echo='echo "$BASH_SOURCE:$LINENO:$FUNCNAME:"' main1() { local a b c d a=20 b=30 c=`expr $a + $b 2 > /dev/null` # should be 2> d=$? test $d -eq 0 -o $d -eq 1 && echo "$c" || echo "error: $a + $b" } main1 $ $ shellcheck hello.sh; bash hello.sh; In hello.sh line 11: c=`expr $a + $b 2 > /dev/null` # should be 2> ^--------------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`. ^--^ SC2003 (style): expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]]. Did you mean: c=$(expr $a + $b 2 > /dev/null) # should be 2> For more information: https://www.shellcheck.net/wiki/SC2003 -- expr is antiquated. Consider rewr... https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le... expr: syntax error: unexpected argument ‘2’ hello.sh:13:main1: error: 20 + 30 $ $ cat /etc/os-release | grep PRETTY_NAME PRETTY_NAME="Debian GNU/Linux trixie/sid" $ $ shellcheck --version ShellCheck - shell script analysis tool version: 0.10.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net $
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Syntax error in redirection is not identified.
The text was updated successfully, but these errors were encountered: