📖 Table of Contents
There are 7 types of shell expansions:
- Brace expansion: Expansions of expressions within
- Tilde expansion: Expansion of
~ to a user’s home directory.
- Parameter and variable expansion: How bash expands the variables.
- Command substitution: Uses the output of a command as text.
- Word splitting: How the results of expansion are split into separate entities or words.
- Arithmetic expansion: How arithmetic expands
- Filename expansion: How globs are expanded
Shell Expansion Order
Brace expansion → Tilde expansion → Parameter expansion → Variable expansion → Arithmetic expansion and command substitution