${(0)…}: Split at null byte

0 splits word at the null byte.

Examples

Splitting a string into words at null bytes
1
2
string=$'several words\0separated by\0null bytes'
echo ${(0)string}
Output:
1
several words separated by null bytes
BashSupport Pro is a Zsh IDE with support for ${(0)…}try it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal