${(p)…}: Enable escape sequences in flags

(p) enables escape sequences and variable substitution for options of the following flags.

By default, options are taken literally, for example ${(s:\t:)name} splits words at a literal \t.

With (p), ${(ps:\t:)name} is splitting words at a TAB character and ${(ps:$sep:)name} splits using the value of variable sep.

Examples

Split string at TABs
1
2
tsv=$'a\tb\tc'
echo ${(ps:\t:)tsv}
Output:
1
a b c
BashSupport Pro 是一款支持 p** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款