shell expansion

The rewriting bash does to a command line before running it, replacing variables, patterns and other special forms with their values.

In more detail

It always happens in a fixed order: brace expansion, tilde expansion, then parameter, command and arithmetic expansion together, then word splitting, then globbing, and quote removal last. Because splitting and globbing come after a value is substituted, an unquoted variable can turn into several words or into file names. Most quoting bugs are surprises about this order.

Related terms

Taught in

References