${(e)…}: Single word shell expansion

(e) performs single word shell expansion on the variable value.

It performs parameter expansion, command substitution, and arithmetic expansion.

Examples

Evaluate shell expansions
1
2
expression='User ${USER} has home $HOME'
echo "'$expression' is expanded into '${(e)expression}'"
Output:
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!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal