[Techtalk] bash and sh

Yaroslav Fedevych jaroslaw at linux.org.ua
Thu May 5 23:50:46 EST 2005


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). 

-- 
X windows: Do your time.



More information about the Techtalk mailing list