I'm new to Linux and learning echo command:$ echo $10000$ echo $1$so why does echo parse $1 as undefined variable and print following zeros but not $100 as a whole? Thanks! I'm using Ubuntu 14.04.
How does echo parse $100?
echo
The positional parameters, $1, $2, ..., $9, contain the command line arguments passed to the current shell or shell function.  The string $100 will be interpreted as $1 followed by two zeroes. This will be 00 if $1 is unset or empty.Setting the positional parameters explicitly in a script and testing it:set -- a b cecho $100 $200 $300This results ina00 b00 c00Since the positional parameters beyond 9 need to be accessed with e.g. ${10}, there is no ambiguity between $1 followed by 00 and positional parameter 10 or 100 (since there are no brackets).If you had wanted to print $100, then you would have to either escape the $ from the shell, or use single quotes:echo \$100echo '$100'