Stephane Chazelas wrote:
And it should be noted (and it's noted as well in the page
you're refering to) that while the above is true for strings
such as "foo" and "bar", it is not true in the general case.

[ -n "$foo" -a -n "$bar" ]

is not the expression to test whether both "$foo" and "$bar" are
non-empty, as it would fail for some specific values of $foo or
$bar (try it when $foo contains "=" for instance).

Huh? Why would having an '=' in foo have any effect? "$foo" is still a string, it should not be subject to word splitting (unless you slapped an 'eval' in front of the mess, but then you have some *serious* quoting issue).

IOW, I do not see any case in which this could return non-zero:
argv[0] = "["
argv[1] = "-n"
argv[2] = some string with '='
argv[3] = "-a"
argv[4] = "-n"
argv[5] = some other non-empty string that might have an '='
argv[6] = "]"

--
Matthew
What, no punchline?



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to