5 ms·
Quoting from your post: "If the command name matches the name of a special built-in utility, that special built-in utility shall be invoked." Let echo be a "s
by Borealid 12y ago
Quoting from your post:
"If the command name matches the name of a special built-in utility, that special built-in utility shall be invoked."
Let echo be a "special built-in utility", and sh is compliant.
- aidenn0 12y ago"special built-in utilities" are specifically listed elsewhere. echo is not among them: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3...
- Borealid 12y agoA lawyerly reading still permits echo to qualify as a special built-in utility. Two relevant excerpts: "The following "special built-in" utilities shall be supported in the shell command language ..." "... The term "built-in" implies that the shell can execute the utility directly and does not need to search for it. An implementation may choose to make any utility a built-in; however, the special built-in utilities described here differ from regular built-in utilities ..." (the two differences are irrelevant to this discussion as they do not mention PATH resolution behaviors) These quotes taken together do not preclude the shell adding a built-in utility and assigning it the "special" status. The standard does not say that only the listed utilities are special; it says that the listed utilities shall be special. Adding a normal built-in utility (not "special") not on the list is explicitly condoned. It is my belief that echo being a "special built-in utility" and thus having magic PATH behavior is POSIX compliant, although the standard is not 100% clear on this.