News for hackers. Stuff that matters.
Re:The Case for the /usr Merge (2012) by pdpi on Wednesday September 07, 2022 @10:59PM (#32760602)
That’s probably a good practice anyway. /bin/sh is guaranteed to exist, but there’s no reason to assume bash is installed at all. If it is installed, /usr/bin, /usr/local/bin, /opt/bin are all reasonable locations.
Re:The Case for the /usr Merge (2012) by hvdijk on Wednesday September 07, 2022 @11:32PM (#32760843)
Even /bin/sh is not guaranteed to exist, and when it does exist, it is not guranteed to be useful. It is not a location specified by POSIX, and implementations exist that do not place the standard sh utility in /bin. The big one was SunOS/Solaris, where /bin/sh did exist but was the pre-POSIX implementation, and /usr/xpg4/bin/sh existed for when you wanted POSIX sh. Android puts it in /system/bin/sh and not all of them have the compatibility symlink /bin -> /system/bin. There are probably other special cases as well.

POSIX explicitly 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 [...]"

Re:The Case for the /usr Merge (2012) by mbreese on Wednesday September 07, 2022 @11:09PM (#32760698)
And that’s the way it is in FreeBSD… /bin/sh exists, but it isn’t bash. Instead, bash must be installed by the user, and is thus installed in /usr/bin.
Re:The Case for the /usr Merge (2012) by kevans91 on Wednesday September 07, 2022 @11:19PM (#32760757)
minor nit: /usr/local/bin as it comes from ports