history question-- Bourne (and C) SHELL COMMENTS

mwm at eris.berkeley.edu mwm at eris.berkeley.edu
Thu Aug 7 09:25:38 AEST 1986


To add some more background to Chris's comments.

The v7 shell did indeed swallow ':' (with parsed argumernts) as a
comment, and did not take '#' as a comment (neither did 2.8BSD
systems). The v6 shell used ':' as a label for branches, so you could
write things like:

	: loop
	who
	sleep 3600
	goto loop

for iterated displays, etc. I wouldn't be suprised if this use of ':'
had something to do with ':''s use in the v7 shell.

I've heard a rumor that berkeley didn't introduce '#' as a shell
comment character, but picked it up from the Unix 2.0 (PWD 2.0) or
Unix 3.0 shells. On the other hand, it was definitely used on v6 & v7
systems running csh by csh to decide if your script was going to be
run by csh or sh.

Similarly, hearsay has it that the explanation for the '#!command' was
that it was an extension of what the pascal interpreter was doing at
the time.

Naturally, corrections by people with hard facts are welcome.

	<mike



More information about the Comp.unix.wizards mailing list