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

Jim Freeman jfree at sovereign.org
Thu Jul 5 10:18:12 PDT 2007


On Thu, Jul 05, 2007 at 12:51:24PM -0400, Paul Smith wrote:
> 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 ]"?

Lots of legacy + 3d party code that should just work, and aren't
mine to change ...


More information about the busybox mailing list