On Mon, Jul 28, 2008 at 11:22 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
That'd work, except for cases of idiocy, like... array=('' {foo,bar,baz}
Arf. And guess what, that is like the 1000000000th thing that works like I want with zsh and not with bash... zsh : echo $array -> foo bar baz bash : echo $array -> nothing, because it displays the first element which is an empty string. Anyway, I have something else, look : [xavier@nx7400 ~]$ array=('' {foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] || echo array not empty bash: [: too many arguments array not empty [xavier@nx7400 ~]$ [ -z "${array[*]}" ] || echo array not empty array not empty I never understood what the differences between @ and * were though... Another thing, I just realized that the current code already seems to work like we want, so this is a small issue. We only get that "too many arguments" message which look very odd and let us think that something probably broke.