Thorsten Glaser t...@mirbsd.de wrote, on 28 Sep 2009:
Clint Adams dixit:
% mksh /tmp/horsies ; echo $?
/tmp/horsies: /tmp/horsies: No such file or directory
1
t...@herc:~ $ mksh /tmp/horsies; print $?
/tmp/horsies: /tmp/horsies: No such file or
Geoff Clare dixit:
Clint is right. Look at the synopsis for sh:
Okay, the HTML versions I had were not easy to search.
Then I’ll fix that in mksh, and Clint should file it
with dash too.
The Austin Group mailing list is open to anyone to join. See
www.opengroup.org/austin/lists.html
Thanks!
Geoff Clare dixit:
So the 127 exit is required for sh /tmp/horsies if /tmp/horsies could
not be found.
Heh. The source code even *tried* to DTRT, setting exstat to 127,
but the errorf() function doing the actual abortion set it to 1…
fixed.
//mirabilos
--
Yay for having to rewrite other
Package: mksh
Version: 38.3-1
% mksh /tmp/horsies ; echo $?
/tmp/horsies: /tmp/horsies: No such file or directory
1
According to SUSv3, the exit code should be 127:
127
A specified command_file could not be found by a non-interactive shell.
--
To
Dixi quod:
(as stdin replacement)
More on this:
t...@frozenfish:~ $ mksh
t...@frozenfish:~ $ true x; echo $?
mksh: cannot open x: No such file or directory
1
t...@frozenfish:~ $ ^D
t...@frozenfish:~ $ bash
t...@frozenfish:~$ true x; echo $?
bash: x: No such file or directory
1
Clint Adams dixit:
% mksh /tmp/horsies ; echo $?
/tmp/horsies: /tmp/horsies: No such file or directory
1
t...@herc:~ $ mksh /tmp/horsies; print $?
/tmp/horsies: /tmp/horsies: No such file or directory
1
t...@herc:~ $ mksh -c /tmp/horsies; print $?
mksh:
6 matches
Mail list logo