|
|
|
|
|
by faho
1434 days ago
|
|
>But... "the shell and standard utilities and files that are in known locations and standard capabilities and various other things" are also specified by POSIX. Unfortunately, it doesn't specify those known locations. It explicitly declines specifying that /bin/sh exists. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/s... says: > Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH, ensuring that the returned pathname is an absolute pathname and not a shell built-in. and it doesn't specify the location of getconf either, so you have a chicken-and-egg problem where you need the standard $PATH to find getconf to get the standard $PATH. |
|
# command -p getconf PATH
If you're writing C code of course you just use the library function.