Le 03/05/2010 20:25, Greg Wooledge a écrit :

> Use if/then/else/fi instead of && ||.  Using && || is dangerous, as I've
> explained here:
> 
> http://mywiki.wooledge.org/BashPitfalls#cmd1_.26.26_cmd2_.7C.7C_cmd3

Also note that using "&&" instead of "if" makes your script totally
incompatible with "set -e", even when using "&&" alone.

Using || alone instead of an "else" is 95% compatible
with "set -e". The 5% caveat is practically the same than the one
documented in Greg FAQ above: the dependent clause must succeed.





Reply via email to