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
(Or "To use cases with ;;&, specify #!/usr/bin/env bash)
Problematic code:
#!/usr/bin/env bash
var=${ mycmd; };
or
#!/usr/bin/env ksh
case "$1" in
foo) echo "Foo!" ;;&
f*) echo "F-something at least" ;;
esac
Correct code:
#!/usr/bin/env ksh
var=${ mycmd; };
or
#!/usr/bin/env bash
case "$1" in
foo) echo "Foo!" ;;&
f*) echo "F-something at least" ;;
esac
Rationale:
You are using a shell syntax feature not supported by the script's shell. Either rewrite the construct, or switch to a different shell interpreter.
Exceptions:
ShellCheck 0.10.0 and below warns about ${ ..; } command expansions when using Bash. However, Bash 5.3 added support for this construct. If you are using this construct in Bash 5.3, either ignore the warning or upgrade ShellCheck.
Related resources:
Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!