[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: archive generated by shar -V does not support the -c option]
From: |
Ralf Wildenhues |
Subject: |
Re: archive generated by shar -V does not support the -c option] |
Date: |
Sun, 29 Aug 2010 02:17:08 +0200 |
User-agent: |
Mutt/1.5.20 (2010-04-22) |
* Bob Proulx wrote on Sun, Aug 29, 2010 at 12:26:14AM CEST:
> Karl Berry wrote:
> > test "X$1" = "X-c" && keep_file=false || keep_file=true
> >
> > Sounds like a good change in principle, but the precedence of && and ||
> > is not portable (or at least it wasn't, NN years ago). Safer to say:
>
> If I recall correctly the order of "cmd1 && cmd2 || cmd3" is okay. As
> I recall it is the other order "cmd1 || cmd2 && cmd3" that was
> problematic. (I went trolling through the autoconf portability docs
> looking for any hints in that area and couldn't find a mention of it.
AFAIK it's strict left-to-right evaluation in both cases. The caveat is
that no programmer expects that evaluation order, which is why if...else
is cleaner. The other portability caveat is when set -e is in the game.
Cheers,
Ralf