-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1037
Vidar Holen edited this page Jan 21, 2015
·
10 revisions
echo "Ninth parameter: $9"
echo "Tenth parameter: $10"
echo "Ninth parameter: $9"
echo "Tenth parameter: ${10}"
For legacy reasons, $10
is interpreted as the variable $1
followed by the literal string 0
.
Curly braces are needed to tell the shell that both digits are part of the parameter expansion.
If you wanted the trailing digits to be literal, ${1}0
will make this clear to both humans and shellcheck.