What is parameter substitution?Nothing more than the run-time substitution of the variable name with its value at that moment.
How can we include default values for our defined variables?
With the ${variable:-value} syntax, where variable is the name and value the default value. This will only be used if the value is null or empty ('').
How can we use parameter expansion to handle missing parameter values?While you would normally use an if [[ -z ${variable} ]]; then, parameter expansion allows you to use the following syntax to generate an error message and exit 1: ${1:?Name not supplied!}
What does ${#*} do?It is the same as $#, which we use to determine the number of arguments passed to our shell script. The general ${#name} ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.