${(j:string:)…}: Splitting with shell parsing

Join array elements using the option as string separator.

Options

string
The string which is used to join the array elements.

Examples

Join array elements into lines
1
2
3
data=(first second third)
# p to support escape sequence \n
echo ${(pj:\n:)data}
Output:
1
2
3
first
second
third
BashSupport Pro 是一款支持 j** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款