${(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.
Links
Examples
- Join array elements into lines
- Output:
1 2 3data=(first second third) # p to support escape sequence \n echo ${(pj:\n:)data}1 2 3first second third
BashSupport Pro is a Zsh IDE with support for ${(j)…} – try it now!