Re: `command -p` Not Searching Path
Martijn Dekker <[email protected]>
| Newsgroups | org.kernel.vger.dash |
|---|---|
| Message-ID | <[email protected]> |
Op 09-08-2026 om 20:49 schreef Nathan Royce: > 5) $ command -p echo //SHOULD have been from PATH, which we made to > be a copy of `ls` The '-p' only changes one thing about the behaviour of 'command': it causes the system's default path list (as shown by 'getconf PATH') to be used instead of $PATH while doing a path search. The purpose is to ignore the user's $PATH setting in cases where it shouldn't be trusted. In other words, the option guarantees the use of known-good standard utilities. The option changes nothing else, so this still only disables the lookup of aliases and functions -- not builtins, which continue to take precedence over external commands. It's not possible to change this without breaking compatibility. -- || modernish -- harness the shell || https://github.com/modernish/modernish || || KornShell lives! || https://github.com/ksh93/ksh