In this chapter, we've discussed everything parameter expansion in Bash. We started by recapping how we've used parameter substitution throughout most of this book, and how parameter substitution is only a small part of Bash parameter expansion.
We moved on to show you how we can use parameter expansion to include default values for variables, in case the user does not supply their own. This functionality also allows us to present the user with an error message if input is missing, although not in the cleanest way.
We ended this introduction to parameter expansion by showing you how we could use this to determine the length of variable values, and we showed you how we've actually used that extensively in the book already, in the form of the $# syntax.
We continued with describing parameter expansions under the heading of Variable manipulation. This includes the functionality of pattern substitution, which allows us to replace a part of the variable's value (the pattern) with another string. In very similar functionality, pattern removal allows us to remove some of the value that matches a pattern.
Next up, we showed you how we can manipulate characters from lowercase to uppercase, and vice versa. This functionality was already mentioned earlier in this book, but we have now explained it in more depth.
We ended this chapter with substring expansion, which allows us to take parts of variables from an offset and/or with a specified length.
The following commands were introduced in this chapter: export and dirname.