-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2080
Ben Peachey edited this page Sep 21, 2018
·
2 revisions
echo $(( 16 - 08 ))
echo $(( 16 - 8 ))
ShellCheck found an integer literal with a leading zero, but containing the digits 8 or 9.
This is invalid, as the integer will be interpreted as an octal value (e.g. 0777 == 0x1FF == 511).
To have the value parsed in base 10, either remove the leading zeros as in the example, or specify the radix explicitly:
echo $((10#08))
None
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!