On Wed, Nov 19, 2014 at 07:59:42PM +0000, Jason Vas Dias wrote:
> [ ${#v[@] -gt 0 ] does not work
> if $v is a normal variable.
Doesn't it? It seems to work for me (once you fix the typo):
imadev:~$ unset v; v=''; test "${#v[@]}" -gt 0 && echo yes
yes
imadev:~$ unset v; v='x'; test "${#v[@]}" -gt 0 && echo yes
yes
imadev:~$ unset v; test "${#v[@]}" -gt 0 && echo yes
imadev:~$
Granted, it's an awkward expression. I'm not arguing against fixing -v.
