Re: [U-Boot] [PATCH V4 06/12] cmd_test: implement ! on sub-expressions

2014-02-04 Thread Tom Rini
On Mon, Feb 03, 2014 at 01:21:04PM -0700, Stephen Warren wrote: > From: Stephen Warren > > Currently, ! can only be parsed as the first operator in an expression. > This prevents the following from working: > > $ if test ! ! 1 -eq 1; then echo yes; else echo no; fi > yes > $ if test ! 1 -eq 2 -

[U-Boot] [PATCH V4 06/12] cmd_test: implement ! on sub-expressions

2014-02-03 Thread Stephen Warren
From: Stephen Warren Currently, ! can only be parsed as the first operator in an expression. This prevents the following from working: $ if test ! ! 1 -eq 1; then echo yes; else echo no; fi yes $ if test ! 1 -eq 2 -a ! 3 -eq 4; then echo yes; else echo no; fi yes Fix this by parsing ! like any