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
Line 3:
echo "$(( $txt ))"
^-- SC2004: $/${} is unnecessary on arithmetic variables.
$
[/code]
Your code says '$/${} are unnecessary with no other errors.
Now try running line 5 on sh, bash, ksh and zsh.
This is at least one exception to the rule.
TIA.
Bazza.
The text was updated successfully, but these errors were encountered:
Take the code below.
[code]
!/bin/sh
txt="1234567890"
echo "$(( $txt ))"
echo "$(( ${#txt} - 1 ))"
echo "$(( #txt - 1 ))"
[/code]
Shell Check ERROR window.
[code]
$ shellcheck myscript
Line 3:$/$ {} is unnecessary on arithmetic variables.
echo "$(( $txt ))"
^-- SC2004:
$
[/code]
Your code says '$/${} are unnecessary with no other errors.
Now try running line 5 on sh, bash, ksh and zsh.
This is at least one exception to the rule.
TIA.
Bazza.
The text was updated successfully, but these errors were encountered: