From Bash manual
3.7.1 Simple Command Expansion
When a simple command is executed, the shell performs the following expansions, assignments, and redirections, from left to right.
The words that the parser has marked as variable assignments (those preceding the command name) and redirections are saved for later processing.
The words that are not variable assignments or redirections are expanded (see Section 3.5 [Shell Expansions], page 21). If any words remain after expansion, the first word is taken to be the name of the command and the remaining words are the arguments.
Redirections are performed as described above (see Section 3.6 [Redirections], page 31).
The text after the ‘=’ in each variable assignment undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable.
It mentions expansions happen on the following parts of a simple command: command name, command arguments, and assignments.
I was wondering if expansion also happens on redirection part? If yes, can you give some examples? Thanks.
a b >c
which is the redirection in the sense of the bash man page. We are talking here about tokenizing the line into words. The words here are a, b, > and c, and it is just the word > which is the redirection word.