[TUHS] Bourne shell and comments

shawn wilson ag4ve.us at gmail.com
Thu Apr 20 10:31:29 AEST 2017


This is a bit old (hope someone has archived it incase the account is ever
deleted) but this is the shebang history reference I've ref'd a few times
(comes right after the Wikipedia hits when searching for "shebang history"
in Google - for me anyway).

https://www.in-ulm.de/~mascheck/various/shebang/

It'd be interesting to hear if the group finds any inaccuracies or knows of
anything more thorough on the topic.

On Apr 19, 2017 6:05 PM, "Steffen Nurpmeso" <steffen at sdaoden.eu> wrote:

> Sven Mascheck <mascheck at in-ulm.de> wrote:
>  |On Wed, Apr 19, 2017 at 06:48:34AM +1000, Warren Toomey wrote:
>  |> I was trying to configure C news on 2.9BSD today and I found that its
>  |> Bourne shell doesn't grok # comments. The Bourne shell in 2.11BSD does.
>  |>
>  |> So I thought: when did the Bourne (and other) shells first grok # as
>  |> indicating a comment? Was this in response to #! being added to the
>  |> kernel, or was it the other way around? And was the choice of #!
>  |> arbitrary, or was it borrowed from somewhere else?
>  |>
>  |> Datum point: 2.9BSD's kernel can recognise #!, but the sh can't
> recognise \
>  |> #.
>  |
>  |Dennis' email about #! to Berkeley is dated Jan 10 '80.
>  |I've never seen any hint, how the bang in #! was chosen. Looks racy \
>  |at least..
>  |#! on BSDs was available as compile time option in 4.0BSD (~Oct '80?)
>  |and default on 4.2BSD (~Sep '83).
>  |BTW, AFAIK, the #! implementation in 2.8BSD (compile time option) is not
>  |from research but seems to come from U.S. Geological Survey, Menlo Park.
>  |
>  |The BSD csh hack in sh&csh (# special as first character in a file, \
>  |service.c),
>  |came with 3BSD, also in '80.
>  |
>  |I found # as comment character in the BSD-sh first in CSRG 4.1.snap
>  |(~Apr '81, word.c). And at Bell Labs, as mentioned, it came with SysIII,
> \
>  |also ~81.
>  |BTW, 4.3BSD ('86), and thus 2.10 BSD, brought an interesting change:
>  |# is only recognized in non-interactive mode. In interactive mode
>  |you actually get this:
>  |  $ # echo x
>  |  #: not found
>  |This was not changed in 4BSD until sh was replaced by ash in 4.3 Net/2.
>
> Hmm.  Kurt Shoens added # as a null() saying "The do nothing
> command for comments." before that (2BSD, file copyright 1979).
>
> --steffen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170419/3f893309/attachment.html>


More information about the TUHS mailing list