Dash as default shell

Ralf Corsepius rc040203 at freenet.de
Thu Oct 2 16:13:53 UTC 2014


On 10/02/2014 03:07 PM, Rahul Sundaram wrote:
> Hi
>
> On Thu, Oct 2, 2014 at 8:59 AM, Chris Adams wrote:
>
>
>     If that's the case, why do we have the /bin/sh symlink?  Just remove it
>     and make the bash dependency explicit (so everything has to call
>     /bin/bash).
>
>
> I understand this is a rherotical argument but the symlink exists
> because it is required by things like system()

No. /bin/sh is supposed to be a POSIX-compatible shell.

I.e. scripts using "#!/bin/sh" shebang rely upon being interpreted 
POSIX-correctly and not to use any feature diverging from POSIX.


As bash implements a superset of POSIX, it changes its behavior to a 
more POSIX-compliant behavior depending upon the name it is being invoked.


AFAIK, dash doesn't seem to have such a difference in behavior built-in. 
It always seems to be using a dash-specific sh-extensions.
 From man dash:
"The current version of dash is in the process of being changed to 
conform with the POSIX 1003.2 and 1003.2a specifications for the shell. 
  This version has many features which make it appear similar in some 
respects to the Korn shell, but it is not a Korn shell clone (see 
ksh(1)). Only features designated by POSIX, plus a few Berkeley 
extensions, are being incorporated into this shell."

Ralf




More information about the devel mailing list