Skip to main content
1 of 3
Jay
  • 255
  • 2
  • 6

Remove all empty strings from an array

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