bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrong logical evaluation of expressions involving true or false comm


From: Matthew Woehlke
Subject: Re: wrong logical evaluation of expressions involving true or false commands
Date: Tue, 26 Jun 2007 10:16:15 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.4.0

Paul Jarc wrote:
Matthew Woehlke <mw_triad@users.sourceforge.net> wrote:
Stephane Chazelas wrote:
[ -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?

I think Stephane meant the exact string "=", not any string containing
"=".

Ah, yes, *that* would cause problems.
/me reads "contains" in the string sense, not the value sense :-)

--
Matthew
"...anyway, that's my 0.02 toasters"
(with apologies to Niel)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]