PW#5-1: Bash vs Bourne shell
[This mail is part of Debian Policy Weekly issue #5]
Topic 1: Bash vs Bourne shell
STATE: APPROVAL
There has been a long discussion on debian-policy about which shell features
can be assumed to be provided by /bin/sh. Currently, a lot of packages use
bash-specific features but specify "#!/bin/sh" as interpreter. Installing
another shell (e.g., ash) as /bin/sh will break these scripts.
Since the use of other shells than bash makes sense for some systems (e.g.,
the "ash" shell requires much less disk and RAM space than "bash"), we
define which functionality packages can expect from /bin/sh. If a certain
shell script requires more functionality than that, the script has to
specify the corresponding shell program (e.g., "#!/bin/bash") and has to
depend on the corresponding package (unless that is tagged `Essential', as
in the case of bash).
I present the following policy change for approval. If noone objects, this
will become official policy:
The standard shell interpreter `/bin/sh' may be a symbolic link to
any POSIX compatible shell. Thus, shell scripts specifying
`/bin/sh' as interpreter may only use POSIX features. If a script
requires non-POSIX features from the shell interpreter, the
appropriate shell has to be specified in the first line of the
script (i.e. `#!/bin/bash') and the package has to depend on the
package providing the shell (unless the shell package is marked
`Essential', of course).
Restrict your script to POSIX features when possible so that it
may use /bin/sh as its interpreter. If your script works with ash,
it's probably POSIX compliant, but if you are in doubt, use
/bin/bash.
----------------------------------------------------------------------------
Reply to: