tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sh -e changes broke pkgsrc



cheusov%tut.by@localhost said:
> Strictly speaking you right.  Though, this is nonsense IMHO. 

You might want to read the other mails to the subject.
In short, the theory is that a "&&" or "||" comprises a
check for the exit status of the (simple) command left of it,
and the "-e" only causes an exit if the staus was not checked.

>   false && false
>   false && true

The non-zero exit status of the first "false" is eaten
by the "&&", the right sides are not executed.

>   true  && false
> does NOT exit with NetBSD's /bin/ksh, pdksh, mksh,

Are you sure? This exits with the ksh of both OSF/1 and NetBSD.

>   false || false
> DOES exit

That's also consistent: the first non-zero exit status is
caught by the "||", the second not.

This seems to boil down to a documentation issue.

best regards
Matthias




-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index