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

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



> > 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?
> 
> /etc/init.d/* do, in fact, all start with "#!/bin/sh" as they should.
> I believe that bash was written to be a free version of and painless
> replacement for sh. So if /bin/sh is a link to bash, all is well.

The problem is that the scripts only work with bash in sh mode and not
with sh-compatible shells such as ash. Try making /bin/sh a symlink to
/bin/ash and reboot. You'll get error messages from the startup
scripts.

Even when invoked as sh, bash has options not available in other sh
clones. The scripts use these options and thus don't work with Bourne
shell clones other than bash.

It would be nice to be able to use ash instead of bash, especially on
small systems, because ash uses less memory.

> The problem arose when the original writer linked /bin/sh to zsh.  I
> understand, perhaps incorrectly, that zsh is a freen version of ksh,
> but it apparently has some failure to mesh with sh/bash.

Zsh, like bash, has sh compatibility options enabled when invoked as
sh.

Most people have no problem using ash or zsh for /bin/sh. But most
people are not Debian users. :-/



Reply to: