Shell programming style -- a pl

Doug Gwyn gwyn at brl-vgr.ARPA
Wed Mar 7 17:52:15 AEST 1984


I have come to regret trying to help the novices by suggesting a way to
get the right command interpreter to execute their shell scripts.  The
claim that has been repeated most is that if your script does not start
with a # character the Bourne shell will execute it is FALSE for the
4.2BSD Cshell.  Only under some circumstances does this happen.  We have
seen scripts staring with : get fed to csh, much to the annoyment of the
user.

My original suggestion, that Bourne shell scripts start with #!/bin/sh,
is completely correct for the following UNIX variants:
	4.2BSD
	4.2BSD with BRL UNIX System V emulation
	UNIX System III
	UNIX System V
If you have some other UNIX system, the interesting question is "why?".



More information about the Comp.unix mailing list