bash vs. ash, [ ! a = b ] vs. [ a != b ]

Paul Smith psmith at netezza.com
Thu Jul 5 16:51:24 UTC 2007


On Thu, 2007-07-05 at 10:38 -0600, Jim Freeman wrote:

> There is a discrepency (== error?) in ash's handling of the following:

> # [ ! a = b ]
> # echo $?
> 1

According to the POSIX standard, this form is valid and ash's answer is
wrong.

> If I'm doing something stupid, let me know - I can take it (I'm
> used to it ...)

This should be fixed in ash, because it's a bug... but I wonder why you
just don't use the much more common (and hence more likely to work
properly) "[ a != b ]"?

-- 
-----------------------------------------------------------------------------
 Paul D. Smith <psmith at netezza.com>                       http://netezza.com
 "Please remain calm--I may be mad, but I am a professional."--Mad Scientist
-----------------------------------------------------------------------------
      These are my opinions--Netezza takes no responsibility for them.



More information about the busybox mailing list