3 ms·
Unless I'm misreading your comment, zsh does provide similar functionality via zsh/mapfile¹. It, and a lot of other cool stuff, is documented in zshmodules(1).
by JNRowe 3y ago
Unless I'm misreading your comment, zsh does provide similar functionality via zsh/mapfile¹. It, and a lot of other cool stuff, is documented in zshmodules(1).
¹ https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fmapfile-Module https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-...
- nerdponx 3y agoI believe Bash readarray/mapfile is more like doing this in Zsh: lines=( "${(@f)$(my_command)}" ) or lines=( "${(@f)$(<my_file)}" ) which IMO is a little less nice than using a builtin with a name like "readarray". But this is cool too.