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: /tmp/horsies: not found
127
>According to SUSv3, the exit code should be 127:
>
> 127
> A specified command_file could not be found by a non-interactive shell.
I tend to disagree. While GNU bash, AT&T ksh93 and zsh do the same
thing for both, neither does dash, nor can I find (quickly) something
in SUSv3 which says anything about the return code when the input file
(as stdin replacement) cannot be opened. The case you bring forward is
*not* a command_file.
Geoff, can you shed some light on this? Is there, by chance, an eMail
address (mailing list, maybe) where people can ask such questions on
SUSv3 and shell behaviour? I'm adding you because you helped out so
well last time when we had the "$@" vs set -u issue.
10x,
//mirabilos
--
Yay for having to rewrite other people's Bash scripts because bash
suddenly stopped supporting the bash extensions they make use of
-- Tonnerre Lombard in #nosec
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]