Op 26-04-18 om 13:48 schreef Joerg Schilling:
Robert Elz <k...@munnari.oz.au> wrote:
| For some commands you need to do that (e.g. if you like to check whether
| "set -o posix" is usable.
Huh? What shell, anywhere, exits on command not found ? (that is, not
counting when the command that was not found was the last, and not when
it was run via "exec").
all conforming shells exit with "set -o bla" in a script.
This has nothing to do with command not found. The 'set' special
built-in command is, in fact, found.
This is the rule that special built-ins shall exit on encountering an
error, which is a completely different thing, also defined in XCU 2.8.1
Consequences of Shell Errors, second row in the table: "Special built-in
utility error": "shall exit".
What we are talking about is the last row in that same table: "Command
not found": "may exit".
Link to that table:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01
- M.