$ dpkg -l | fgrep dash
ii dash 0.5.7-2ubuntu2
POSIX-compliant shell
$ exec 9no_such_file echo TEST
dash: 1: cannot open no_such_file: No such file
$ exec 9no_such_file || echo TEST
dash: 2: cannot open no_such_file: No such file
So, I cannot
* Марк Коренберг socketp...@gmail.com [2014-01-28 13:16]:
$ dpkg -l | fgrep dash
ii dash 0.5.7-2ubuntu2
POSIX-compliant shell
$ exec 9no_such_file echo TEST
dash: 1: cannot open no_such_file: No such file
$ exec 9no_such_file || echo
Le Tue, 28 Jan 2014 15:05:23 +0100
Guido Berhoerster a écrit:
[...]
if ( exec 9no_such_file ) 2/dev/null; then
exec 9no_such_file
else
echo TEST
fi
That's generally a bad idea since it is racy, if no_such_file is
removeded in between the test and actual exec your script
On 2014-01-28, at 05:16, Марк Коренберг wrote:
$ dpkg -l | fgrep dash
ii dash 0.5.7-2ubuntu2
POSIX-compliant shell
$ exec 9no_such_file echo TEST
dash: 1: cannot open no_such_file: No such file
$ exec 9no_such_file || echo TEST
dash:
On Tue, Jan 28, 2014 at 02:17:59PM +0100, Guido Berhoerster wrote:
* Марк Коренберг socketp...@gmail.com [2014-01-28 13:16]:
$ dpkg -l | fgrep dash
ii dash 0.5.7-2ubuntu2
POSIX-compliant shell
$ exec 9no_such_file echo TEST
dash: 1:
On 1/28/14, 4:59 PM, Jilles Tjoelker wrote:
That's either a bug or an intended deviation from the POSIX
standard, you'll have to ask on the bug-bash list about that.
It's a bug in bash. Bash doesn't exit when the command is on the LHS
of a || or .
Chet
--
``The lyf so short, the craft so