Skip to main content
3 of 3
a tag alone is not quite sufficient for a question specific to a particular kind of shell

Remove all empty strings from an array in Zsh

How do I remove all empty strings from a Zsh array?

a=('a' '' 'b' 'c')
# remove empty elements from array
echo ${(j./.)a}

Should output a/b/c

Jay
  • 255
  • 2
  • 6