> -e
> When this option is on, if a simple command fails for any of the reasons
> listed in Consequences of Shell Errors or returns an exit status value >0, and
> is not part of the compound list following a while, until, or if keyword, and
> is not a part of an AND or OR list, and is not a pip
Chet Ramey wrote:
Roman Rakus wrote:
Hi
there is simple script:
#!/bin/sh
echo foo|cat /nosuchfile
echo "here: $?"
executed by sh -e
In bash-3.2 we got:
cat: /nosuchfile: No such file or directory
but in bash-4.0:
cat: /nosuchfile: No such file or directory
here: 1
The bash-4.0 behav
Chet Ramey wrote:
Roman Rakus wrote:
If this stays as it is, bash will never exit immediately if a command
(in this case pipeline) exits with a non-zero status.
That's clearly not true. Bash will not exit if a pipeline fails, but
will do so if a simple command fails.
Isn't it th
Roman Rakus wrote:
> If this stays as it is, bash will never exit immediately if a command
> (in this case pipeline) exits with a non-zero status.
That's clearly not true. Bash will not exit if a pipeline fails, but
will do so if a simple command fails.
--
``The lyf so short, the craft so long
Roman Rakus wrote:
> Hi
> there is simple script:
> #!/bin/sh
> echo foo|cat /nosuchfile
> echo "here: $?"
>
> executed by sh -e
> In bash-3.2 we got:
> cat: /nosuchfile: No such file or directory
>
> but in bash-4.0:
> cat: /nosuchfile: No such file or directory
> here: 1
The bash-4.0 behavior
Roman Rakus wrote:
Hi
there is simple script:
#!/bin/sh
echo foo|cat /nosuchfile
echo "here: $?"
executed by sh -e
In bash-3.2 we got:
cat: /nosuchfile: No such file or directory
but in bash-4.0:
cat: /nosuchfile: No such file or directory
here: 1
From execute_cmd.c:
/* 10/6/2008 -- added te
Hi
there is simple script:
#!/bin/sh
echo foo|cat /nosuchfile
echo "here: $?"
executed by sh -e
In bash-3.2 we got:
cat: /nosuchfile: No such file or directory
but in bash-4.0:
cat: /nosuchfile: No such file or directory
here: 1
From execute_cmd.c:
/* 10/6/2008 -- added test for pipe_in and p