Re: Why sh does not return a false value?

2011-02-05 Thread Davide Brini
On Sat, 5 Feb 2011 16:17:05 +0330 ali hagigat hagigat...@gmail.com wrote: if (sh -c exit 34) then echo p;fi p The following condition should be false, because our exit value is non-zero. but 'if' considers the condition as true and executes 'echo' command. Why? Try if (sh

Re: Why sh does not return a false value?

2011-02-05 Thread Maarten Billemont
On 05 Feb 2011, at 13:47, ali hagigat wrote: if (sh -c exit 34) then echo p;fi p The following condition should be false, because our exit value is non-zero. but 'if' considers the condition as true and executes 'echo' command. Why? You are giving -c the argument 'exit'