There is one expression: echo ${100} In the terminal, it returns an empty value. The documentation did not find why this happens?
1 answer
${100} is the value of parameter number one hundred.
in the terminal (or terminal emulator), the shell usually runs without any parameters at all (only with some options), respectively, the values of all parameters (starting with the first one - $1 or ${1} ) will be empty.
this is by no means bash- specific, but described in the posix standard:
- positional parameters
- about curly brackets, it also says that if the number is more than nine (i.e. consists of more than one digit), then it must be enclosed in braces, i.e., use so-called parameter expansion .
|