exec command and error checking

2014-01-28 Thread Марк Коренберг
$ 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

Re: exec command and error checking

2014-01-28 Thread Guido Berhoerster
* Марк Коренберг 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

Re: exec command and error checking

2014-01-28 Thread Seb
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

Re: exec command and error checking

2014-01-28 Thread Paul Gilmartin
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:

Re: exec command and error checking

2014-01-28 Thread Jilles Tjoelker
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:

Re: exec command and error checking

2014-01-28 Thread Chet Ramey
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