[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /bin/sh != /bin/bash ? [was Re: zsh vs bash]



On Wed, 12 Mar 1997, Steve wrote:

> > I set my system shell to zsh as well, and replaced all the /bin/bash
> > in /etc/passwd to /usr/bin/zsh, but when I tried to move /bin/sh to
> > point to /usr/bin/zsh, all of the /etc/init.d/* scripts blew up.
>
> If those scripts actually require bash then why isn't the first line
> #!/bin/bash? Is this a bug, or is it written in stone that /bin/sh and
> /bin/bash are equivalent?

/bin/sh and /bin/bash are not equivalent. bash is a superset of sh
functionality. bash behaves differently depending on whether it is
invoked as sh or as bash (at least the new version 2 does).

bash when invoked as /bin/sh is more posix compliant. when invoked as
/bin/bash, all the bash enhancements are available.


e.g. /usr/sbin/dwww-doc-index from the dwww package doesn't work at all
if the first line is '#! /bin/sh', but works correctly if the first line
is '#! /bin/bash'.

(reminds me, i should submit this as a bug report. nope, no need...it's
already reported as bug #7267 with a patch to fix it)


craig


Reply to: