The standard POSIX shell is sh
, not bash
. So you can assume POSIX systems will have a bourne-compatible shell available and called sh
, but there is no reason to assume they will have bash
installed, nor that it will be at /bin/bash
. In fact, the POSIX specification doesn't even require sh
to be /bin/sh
:
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.
For example, to determine the location of the standard sh utility:
command -v sh
On some implementations this might return:
/usr/xpg4/bin/sh
Furthermore, on systems that support executable scripts (the "#!"
construct), it is recommended that applications using executable
scripts install them using getconf -v to determine the shell pathname
and update the "#!" script appropriately as it is being installed (for
example, with sed).
So the reason that /bin/bash
isn't standard is that bash
isn't standard. Which is precisely why env
exists and why #!/usr/bin/env bash
is the portable solution for this sort of thing.
That said, if it's your system, that's completely up to you. There is no reason not to add a symlink in /bin/bash
pointing to wherever your bash
is installed. If your bash
is in, for example, /usr/bin
, you could just open a root shell and run:
ln -s /usr/bin/bash /bin/bash
As long as you own the system, or you clear this with the local sysadmin, there should be no problem.