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:
#!/bin/sh
foo=1
bar=2
:"$((foo =< bar ? foo : bar))"
Here's what shellcheck currently says:
$ shellcheck myscript
foo=1
^-- [SC2034](https://www.shellcheck.net/wiki/SC2034) (warning): foo appears unused. Verify use (or export if used externally).
bar=2
^-- [SC2034](https://www.shellcheck.net/wiki/SC2034) (warning): bar appears unused. Verify use (or export if used externally).
[Line 6:](javascript:setPosition(6, 4))
: "$((foo =< bar ? foo : bar))"
^-- [SC1102](https://www.shellcheck.net/wiki/SC1102) (error): Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors.
^-- [SC2205](https://www.shellcheck.net/wiki/SC2205) (warning): (..) is a subshell. Did you mean [ .. ], a test expression?
^-- [SC2283](https://www.shellcheck.net/wiki/SC2283) (error): Remove spaces around = to assign (or use [ ] to compare, or quote '=' if literal).
^-- [SC2094](https://www.shellcheck.net/wiki/SC2094) (info): Make sure not to read and write the same file in the same pipeline.
^-- [SC2035](https://www.shellcheck.net/wiki/SC2035) (info): Use ./*glob* or -- *glob* so names with dashes won't become options.
^-- [SC2094](https://www.shellcheck.net/wiki/SC2094) (info): Make sure not to read and write the same file in the same pipeline.
$
Here's what I wanted or expected to see:
$ shellcheck myscript
No issues detected!
$
The text was updated successfully, but these errors were encountered:
apprehensions
changed the title
SC2094, SC2035, SC2034, SC2205 ternary arithmetic false positives
SC2094, SC2035, SC2034, SC2205, SC2283 ternary arithmetic false positives
May 15, 2024
For bugs
shellcheck --version
or "online"): 0.10.0 & onlineFor new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
The text was updated successfully, but these errors were encountered: