${(e)…}
: Single word shell expansion
(e)
performs single word shell expansion on the variable value.
It performs parameter expansion, command substitution, and arithmetic expansion.
Links
- Zsh manual on parameter expansion flags
- Zsh manual on parameter expansion
- Zsh manual on command substitution
- Zsh manual on arithmetic expansion
Examples
- Evaluate shell expansions
- Output:
1 2
expression='User ${USER} has home $HOME' echo "'$expression' is expanded into '${(e)expression}'"
1
'User ${USER} has home $HOME' is expanded into 'User username has home /home/username'
BashSupport Pro is a Zsh IDE with support for ${(e)…} – try it now!