What am I wanting to see after make check on glibc.

Jörg W Mittag Joerg.Mittag at Web.De
Sat Nov 8 08:40:52 PST 2003


[Intentional Fullquote]

Pascal J.Bourguignon wrote:
> Kevin P. Fleming writes:
>> Pascal J.Bourguignon wrote:
>>> % true && echo yes || echo no
>>> yes
>>> % false && echo yes || echo no
>>> no
>> I've never seen that before (obviously). I also can't find anything in 
>> the bash documentation that states it should work that way, so I'd be 
>> concerned about relying on it. Can anyone show me where the docs say 
>> this is expected behavior?
> man bash is clear about it:
> 
>        The control operators && and || denote AND lists  and  OR  lists,
>        respectively.  An AND list has the form
> 
>               command1 && command2
> 
>        command2  is  executed  if, and only if, command1 returns an exit
>        status of zero.
> 
>        An OR list has the form
> 
>               command1 || command2
> 
>        command2 is executed if and only if command1 returns  a  non-zero
>        exit  status.   The return status of AND and OR lists is the exit
>        status of the last command executed in the list.
> 
> The exit status of c1&&c2 is  that of the last command executed in the
> list. When c1 returns a non  null status, then c2 is not executed then
> the status of c1&&c2 is that of c1. Hence you can append ||c3 and have
> it executed.

Just for the sake of completeness, this is what POS^H^H^HSUSv3 has to
say about it:

<URL:http://opengroup.org/onlinepubs/007904975/utilities/xcu_chap02.html#tag_02_09_03>:
| Lists
|
| An AND-OR list is a sequence of one or more pipelines
| separated by the operators "&&" and "||" . 
[...]
| The operators "&&" and "||" shall have equal precedence and shall
| be evaluated with left associativity. For example, both of the
| following commands write solely bar to standard output: 
| 
| false && echo foo || echo bar
| true || echo foo && echo bar 

Actually, looking at SUSv2
<URL:http://opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_009_003_003>
and <URL:http://rhols66.adsl.netsonic.fi/era/unix/shell.html>, which is a
HTMLification of Steve R. Bourne's original tutorial from way back in the 70s, it
seems that this should work in just about *any* Bourne/POSIX/SUS compliant UNIX
shell.

jwm
-- 
Eterm-0.9.2% ./configure
checking for life_signs in -lKenny... no
  Oh my god, they killed Kenny!  You bastards!



More information about the lfs-support mailing list