[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why sh does not return a false value?
From: |
Davide Brini |
Subject: |
Re: Why sh does not return a false value? |
Date: |
Sat, 5 Feb 2011 12:40:36 +0000 |
User-agent: |
|
On Sat, 5 Feb 2011 16:17:05 +0330
ali hagigat <hagigatali@gmail.com> wrote:
> if (sh -c exit 34) then echo ppppppppp;fi
> ppppppppp
> 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 -c 'exit 34') then echo pppp; fi
and read about the -c option in the man page.
--
D.