${(%)…}
: Expand as prompt
Expands all %
escapes in the same way as in prompts. %%
is enabling full prompt expansion.
Links
Examples
- Print username, TTY, and machine using prompt expansion
- Output:
1 2
message='User "%n" on TTY "%l" on machine "%M"' echo ${(%)message}
1
User "UserName" on TTY "pts/1" on machine "MachineName"
BashSupport Pro is a Zsh IDE with support for ${(percent)…} – try it now!