Replacing new lines with spaces in zsh
02 Feb 2023Another one of those things I need to often do in zsh and never remember the syntax.
I had a multiline string (as returned by fzf
) and wanted to convert it into a single line, with spaces instead of spaces.
This was the right formula: selection=("${(f)selection}")
Want to add something ? Feel free to get in touch on Twitter : @pixelastic