Doug McIlroy wrote:
>Brian Walden's discussion of sh #, etc, is right on.
>However, his etymology for unary * in C can be
>pushed back at least to 1959. * was used for
>indirect addressing in SAP, the assembler for
>the IBM 7090.
Thank you for both the confirmation and also that history update.
-Brian
>
>> From: Warner Losh <imp(a)bsdimp.com>
>
>> There's no wupus source before V7.
>
> If you look at Clem's original message:
>
>>> From: Clem Cole <clemc(a)ccc.com>
>>> Date: Mon, 6 Jan 2020 16:08:50 -0500
>
>>> You got my curiosity up and found the V5 and V6 source code
>
> (the one Will was replying to), Clem's talking about the source to crt0.s,
> etc.
>
> Noel
>
Sorry. I could have been clearer. I thought Clem was saying that he found the Wumpus code in v5/v6. Now, I see that he was just talking about the crt files. When I said I couldn’t find the source prior to v7, I meant the wumpus source :).
On another note, porting the v7 code to MacOS is tricky, lots of minor differences, but I’m giving it a go. Prolly easier to just figure out what it’s supposed to do and do it with modern idioms, but it’s a fun puzzle to try to replicate the same functionality with only minor adjustments.
Will
> From: Warner Losh <imp(a)bsdimp.com>
> There's no wupus source before V7.
If you look at Clem's original message:
>> From: Clem Cole <clemc(a)ccc.com>
>> Date: Mon, 6 Jan 2020 16:08:50 -0500
>> You got my curiosity up and found the V5 and V6 source code
(the one Will was replying to), Clem's talking about the source to crt0.s,
etc.
Noel
> I'm interested in the possible motivations for a redirection to be
> a simple command.
I use it to truncate a file to zero length.
Or to create (an empty) file.
Doug
> From: Will Senn
> On another note,You said you looked in v5 and v6 source code? I looked
> at tuhs and didn't see anything earlier than v7. Where did you find
> them?
Huh? https://www.tuhs.org/cgi-bin/utree.pl
Noel
i started on the 7th edition on a perkin elmer (ne interdata) - this was v7 with some 2.1bsd sprinkled on top.
i remember the continual annoyance of unpacking shar files starting with hash comments : only on ed7. in the end i wrote a trivial sed to remove them called unshar.
i haven't thought of that for decades...
-Steve
Mike Haertel:
That's amusing, considering that the 5620 stuff was in /usr/jerq on
Research systems! Apparently the accident became institutionalized.
=====
I remember the name Jerq being tossed around to mean 5620
when I was at 1127. That doesn't mean it was historically
accurate, but it is consistent with the directory names, and
the latter are probably where I got my mistaken idea of the
history.
Thanks to Rob, who certainly should know, for clearing it up.
Norman Wilson
Toronto ON
Brian Walden's discussion of sh #, etc, is right on.
However, his etymology for unary * in C can be
pushed back at least to 1959. * was used for
indirect addressing in SAP, the assembler for
the IBM 7090.
Richard Salz wrote:
>> not the kernel. This had traditionally been done after the exec() failed
>> then shell ould run "sh argv[0]", but with two shells this was now a
>> problem.
>>
>
>It seems the kernel did that; http://man.cat-v.org/unix_7th/2/exec since
>argv[-1] was altered.
As a user of these systems, the offical 7th Edition kernel most certainly
could not execute a script, only binaries. It happend after the release
1979 and took time to make its way out, which it did via DSB before 8th Ed
was finalized in 1985.
The usenet announcement of this new functionality from Dennis is on
Jan 10, 1980. Is listed here https://en.wikipedia.org/wiki/Shebang_(Unix)
Dennis stated the idea was not his, it came up during csonverastions at
a conference.
-Brian
More than you ever wanted to know about #
The first shell to use it as a comment was csh(1), Bill Joy did this.
This was also pre #! in the kernel so the shell had to exec scripts,
not the kernel. This had traditionally been done after the exec() failed
then shell ould run "sh argv[0]", but with two shells this was now a problem.
So csh would look at the first line of the script and if it was a #\n
it would exec csh on it if not it would exec sh(1) on it. This was check
was also placed into to BSD's (not v7 nor att's) bourne shell so it could
run csh scripts as well.
However this was not the first use of # as a comment character. That award
goes to Brian Kernighan's ratfor(1) (rational fortran) compiler in 1974-75.
Then Feldman used in make(1) in 1976, followed by Kernighan's m4(1), learn(1)
and most famously awk(1) in 1977
Bourne shell, written around 1976, eventualy picked this up later on but after
the initial v7 release. And as some noted the : was kind of a comment, it
was a command that did an exit(0) orginally for labels for Thompson's
shell's goto command. The : command was eventually hard linked to the
true(1) command
Remember # was hard to type on teletypes as that was the erase character, so
to enter it, you needed to type \#
(# as erase and @ as line kill came from multics btw)
It was so hard to type that the orignal assember based on DEC PAL-11R,
that addressing syntax changed @ to * and # to $.
In DEC it would be--
MOV @X, R0;
In UNIX asm it became --
mov *x, r0
So this is also why C pointers use * notation.
-Brian
> From: Dave Horsfall dave at horsfall.org
>
>On Sat, 4 Jan 2020, Chet Ramey wrote:
>
>>> Which reminds me: which Shell introduced "#" as a true comment?
>>
>> Define "true comment." The v7 shell had `#' as the comment character, but
>> it only worked when in non-interactive shells. I think it was the Sys III
>> shell that made it work when the shell was interactive.
>
>Yes, that's what I meant.
>
>> This is, incidentally, why bash has the `interactive_comments' option,
>> which I saw in another message. BSD, which most of the GNU developers were
>> using at the (pre-POSIX) time, used the v7 shell and didn't have
>> interactive comments. When a sufficiently-advanced POSIX draft required
>> them, we added it.
>
>I never did catch up with all the options on the various shells; I just
>stick with the defaults in general. Eg:
>
> aneurin% man bash | wc -l
> 5947
>
>Life's too short...
>
>-- Dave