#! in shell scripts

Guy Harris guy at rlgvax.UUCP
Tue Mar 6 16:28:37 AEST 1984


> I have it on good authority that the #! kernel hack for making shell
> scripts directly executable is a 32Vism. Since 4BSD is a 32V derivative,
> it has it. Since System III and V are not 32V derivatives, they don't.

It is *definitely* a Bell Labs invention, but I suspect it wasn't in 32V
(not having the source, I can't check; anybody out there actually run 32V?)
because the paper "Changes in the Kernel in 4.1BSD/May 10, 1981" by Bill
Joy, which comes with 4.1BSD, says under "sys1.c":

	Implements the "#!" executable shell script scheme.

So I suspect the only publicly released version of UNIX which has it is
4.xBSD (and 2.xBSD if it has it).  Also, I suspect System III (VAX-11) is
a 32V derivative in the same sense that System III (PDP-11) is a V7 derivative;
the original work done by Reiser, London, et al was picked up by USG to
make the VAX-11 version of USG UNIX.  The reason that it appears in 4.xBSD
and not other versions is probably that Berkeley were the only people that
picked it up from the Labs ("style", "diction", EFL, SDB and symbolic links
are also Bell Labsisms but for quite a while the only way you could get the
first four was from 4.1BSD, and the latter only appears in 4.2BSD).

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix mailing list