From mboxrd@z Thu Jan 1 00:00:00 1970 From: steffen@sdaoden.eu (Steffen Nurpmeso) Date: Thu, 20 Apr 2017 00:07:28 +0200 Subject: [TUHS] Bourne shell and comments In-Reply-To: <20170419210224.GA701493@lisa.in-ulm.de> References: <20170418204834.GA22198@minnie.tuhs.org> <20170419210224.GA701493@lisa.in-ulm.de> Message-ID: <20170419220728.H4VbN%steffen@sdaoden.eu> Sven Mascheck 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