How to specify a system-wide path variable, used by including fcron,background-processes and sourced rc scripts and all different shells.
# This PATH may be clobbered by individual applications. Notably, by default,
# rc(8), service(8), and cron(8) will all override it with a default PATH that
# may not include /usr/local/sbin and /usr/local/bin when starting services or
# jobs.
daemon:\
:path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin:\
:mail@:\
:memorylocked=256M:\
:tc=default:
ENVIRONMENT
When used to run rc.d scripts the service command sets HOME to / and PATH
to /sbin:/bin:/usr/sbin:/usr/bin which is how they are set in /etc/rc at
boot time.
also binaries that escalate privilegesIt is imprudent to rely on anything in the environment being "right", and has ever been thus.
All scripts should set (and export) their PATH explicitly.
Still depended on the shell, not the OS.Hm, Bourne shells are specified in POSIX– so, kind of a "Unix thing"
![]()
A POSIX (Bourne) shell is part of any POSIX-compliant OS, other shells aren'tStill depended on the shell, not the OS.
I don't think that's true though. NT4 was POSIX compliant (certified even) but it didn't have a POSIX shell.A POSIX (Bourne) shell is part of any POSIX-compliant OS
Yeah, sorry, taking this a bit off topicNot that it's really important in this context…
Did a quick research on this: You're right, just because "POSIX compliant" lacks some precision. NT4 was POSIX.1 compliant, in a nutshell covering kernel and library APIs. It wasn't POSIX.2 compliant, which covers shell and utilities (likeI don't think that's true though. NT4 was POSIX compliant (certified even) but it didn't have a POSIX shell.
ls
).ls
, hehe…Hm, indeed. But interestingYeah, sorry, taking this a bit off topic![]()