[TUHS] History of #! interpretation in Unix

Jeremy C. Reed reed at reedmedia.net
Tue Jan 18 08:41:39 AEST 2011


On Mon, 17 Jan 2011, John Cowan wrote:

> > This seems to indicate the idea was not developed separately at 
> > Berkeley.
> 
> Thanks for doing the digging.  What this shows is that dmr came up with
> the idea of putting shebang processing into the kernel, but it does not
> show where shebangs as a shell feature came from.  I still think that
> has to be the CSRG.

As a similar feature, Joy's experimental "ashell" in the first BSD had a 
feature to run Pascal objects (started with the magic 0404 octal word) 
with the px interpreter. In 2BSD (and then 3BSD), his new csh had the 
OTHERSH feature -- if it started with # it would use csh; if the script 
did not begin with the # it would use /bin/sh.

I still don't see the same #! feature, but the above appear they may be 
inspiration. Also the 1BSD and 2BSD predate CSRG.

> > It was introduced into BSD by April 1981. For 2BSD (2.8) it was added by 
> > Dec. 16, 1981 when built with MENLO_SCRIPT defined (but I don't see that 
> > documented or defined).
> 
> Thanks again for clarifying the ordering here: I had assumed that 2.8
> was older than 4.0.




More information about the TUHS mailing list