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

Bill's LFS Login lfsbill at nospam.dot
Sat Nov 8 08:19:57 PST 2003


On Sat, 8 Nov 2003, S. Anthony Sequeira wrote:

> On Sat, 08 Nov 2003 08:38:32 -0700, Kevin P. Fleming penned:
>
> > Pascal J.Bourguignon wrote:
> >
> >><snip>

> I have been using it for years on a variety of shells.  And yes, it does
> work, and no I would not expect it not to work.  It is shorthand for
> (untested pseudocode)
>
> if [ $? = 0 ]
> then
>   echo yes
> else
>   echo no
> fi

In the simple case you cite, yes. But in cases where multiple commands
appear in the "then" or "else" case, the results may vary significantly
from the results of "&&" and "||" combinations. And as Pascal pointed
out, reversing the order of "&&" and "||" *may* alter the results
because of the way return codes are handled with the conditional
execution operaters vs. the "if, then, else" sequence. With the "if,
then, else", the sense of tests, and therefore the order of the
resulting execution code, can be altered without altering the ultimate
results of the pipeline. Not true with the conditional operators.

Further, implied again by Pascal's post, the result code of the first
command executed can cause inadvertant execution of commands controlled
by the alternate case, which is not true with the "if, then, else"
construction.

>
> Cheers
>

-- 
Bill Maltby
lfsbillATwlmcsDOTcom
Fix line above & use it to mail me direct.



More information about the lfs-support mailing list