Re: removing null elements from an array

2008-07-18 Thread Stephane Chazelas
On Fri, Jul 18, 2008 at 08:52:47AM -0400, Poor Yorick wrote: > Stephane Chazelas wrote: >> >> In zsh, removing the empty elements is just a matter of >> >> var1=($var1) > > Wouldn't this corrupt the elements with spaces, just as in bash? [...] No, zsh doesn't do word splitting (nor filename genera

Re: removing null elements from an array

2008-07-18 Thread Poor Yorick
Stephane Chazelas wrote: In zsh, removing the empty elements is just a matter of var1=($var1) Wouldn't this corrupt the elements with spaces, just as in bash? -- Yorick

Re: removing null elements from an array

2008-07-18 Thread Stephane Chazelas
On Thu, Jul 17, 2008 at 11:12:47PM +, Poor Yorick wrote: > To get rid of null elements in an array, I currently do something like this: > > bash-3.2$ var1=("with spaces" "more spaces" '' "the end") > bash-3.2$ for v in "[EMAIL PROTECTED]"; do if test "$v"; then > var2+=("$v"); fi; do