3 ms·
Indeed, I an older version of https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html https://pubs.opengroup.org/onlinepubs/969991
by aidenn0 7y ago
Indeed, I an older version of https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html https://pubs.opengroup.org/onlinepubs/9699919799.2018edition... in two weekends. (I never got around to implementing job control).
While doing so, I found a part of the specification that (as far as I can tell) no shell implements (sourcing my /etc/profile failed with my shell due to the difference): the specification blesses (at the time)[1] 20 utilities that should be run without regards to the PATH, but any other built-ins should not be run if the command does not exist in the path.
So, for example:
PATH=""
echo "Hello"
Should fail on every POSIX compliant shell. I haven't found a shell that implements echo as a builtin in which the above fails though.
1: Now it has a larger list for which it is unspecified what happens. See "Command search and execution" for the list. "echo" is not on the list though, so my example is still well-defined in POSIX yet breaks on all shells I tried.
- JdeBP 7y agoYou want the Watanabe shell in its POSIX-conformant mode. * https://unix.stackexchange.com/a/496291/5132 https://unix.stackexchange.com/a/496291/5132 * https://unix.stackexchange.com/a/496377/5132 https://unix.stackexchange.com/a/496377/5132 Also observe the /opt/ast/bin mechanism in the '93 Korn shell.
- aidenn0 7y agoWow, someone actually did it! When I reported this non-conformance to the dash mailing-list, I first got pushback that I was wrong about the spec, and then once I convinced them I was right the response was something along the lines of "that's stupid why would we do that"