POSIX does permit ${10}, ${11}, etc. - https://github.com/koalaman/shellcheck/issues/621

Eliah Kagan
2019-07-30 01:37:21 -04:00
parent 434a724627
commit 454dfb5980

@@ -20,8 +20,6 @@ For legacy reasons, `$10` is interpreted as the variable `$1` followed by the li
Curly braces are needed to tell the shell that both digits are part of the parameter expansion. Curly braces are needed to tell the shell that both digits are part of the parameter expansion.
Please note that accessing any positional parameters beyond `$9` using `${num}` is non-POSIX.
### Exceptions ### Exceptions
If you wanted the trailing digits to be literal, `${1}0` will make this clear to both humans and shellcheck. If you wanted the trailing digits to be literal, `${1}0` will make this clear to both humans and shellcheck.