[TUHS] Shell control through external commands

Sven Mascheck mascheck at in-ulm.de
Mon Sep 12 04:50:53 AEST 2016

On Sun, Sep 11, 2016 at 02:27:48PM -0400, Dan Cross wrote:
> On Sun, Sep 11, 2016 at 1:39 PM, Doug McIlroy <doug at cs.dartmouth.edu> wrote:
> > > IIRC #! originated at Bell Labs but it got out to the world via BSD.
> > > Perhaps Dr. McIlroy could confirm / deny / expand upon the details
> > (please?)
> >
> > I recall Dennis discussing the feature at some length before installing it.
> > So the exact semantics, especially the injected argument, are almost]
> > certainly his. I don't know whether he built on a model from elsewhere.
> > #! appeared between v7 (1979) and v8 (1985). As v8 was never released,
> > it clearly made its way into the world via BSD and USG. BSD, being
> > more nimble, was likely first.
> Also, 8th edition was essentially a re-port of 4.1c BSD, correct? If it
> were already in BSD, it could conceivably come back into 8th edition via
> that route. I found the following in /usr/src/sys/sys/TODO for 4.0BSD:
> 6. Exec fixes
> >         Implement dmr's #! feature; pass string arguments through faster.

See 4.0BSD /usr/src/sys/newsys/sys1.c
for two mails from Dennis to Berkeley, sending the info and code.

> >From dmr Thu Jan 10 04:25:49 1980 remote from research
> The system has been changed so that if a file being executed
> begins with the magic characters #! , [...]

I tried to follow all the traces of #! and collected the results on
I'd be happy to add and fix stuff, if somebody spots anything.

Warren, one has to be careful not to have trailing slashes in web archive URLs.
(e.g., after modifying URLs by hand). Example: calling
eventually results in the link
which yields "...is not a known file.", while
is valid.


More information about the TUHS mailing list