[Techtalk] bash and sh

Wim De Smet kromagg at gmail.com
Fri May 6 09:02:33 EST 2005


On 5/5/05, Yaroslav Fedevych <jaroslaw at linux.org.ua> wrote:
> On Thu, May 05, 2005 at 02:42:27PM +0100, Dan wrote:
> > I have a question that's more theoretical than practical, but it's
> > important to me to know.
> >
> > Many scripts start with #!/bin/sh, but proceed to do things that aren't
> > compatible with shells like tcsh. Even a normal "if" statement isn't the
> > same between the two shells.
> >
> > So the question is: does The Standard require sh to be similar to bash,
> Quite reverse. Bash must be similar to sh. sh is "generic" Bourne shell.
> 
> > or would it be equally correct for sh to be a symbolic link to tcsh or
> > zsh?
> 
> Nope. tcsh comes from csh. Bash comes from Bourne shell. zsh i don't
> remember exactly,  but AFAIR it is similar to Korn shell. They are all
> different and incompatible between each other, however, they must be
> compatible to their predecessors.
> 
> Hence, on a modern system, sh may be a link to bash; csh, to tcsh; and ksh,
> to pdksh (or zsh if I'm right with my flying guess about its roots).
> 

I agree almost completely, except I think that ksh is also sh-compatible.

greets,
Wim


More information about the Techtalk mailing list