${(%)…}
: 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 是一款支持 percent** 的 **Zsh 集成开发环境 - 立即试用!