${(F)…}: Join array with newlines

(F) joins the elements of an array together using newlines (\n).

${(F)name} is equivalent to ${(pj:\n:)name}.

Examples

Join array elements with `
`
1
2
values=(first second third)
echo -e "Array elements:\n${(F)values}"
Output:
1
2
3
4
Array elements:
first
second
third
BashSupport Pro is a Zsh IDE with support for ${(F)…}try it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal