'#' as comment character vs. '#' as erase character

Guy Harris guy at sun.uucp
Fri Jun 28 16:32:34 AEST 1985


> A better question is why the '#' character was used as a comment character
> when the typical UNIX*TM Operating System came with '#' as the default
> character-delete character?

The first publicly available Bourne shell that used '#' as a comment
character came with 4.1BSD (or maybe an earlier release).  Most users of
Berkeley UNIX set their delete character to RUBOUT (or maybe BACKSPACE in
some cases).  The 4.xBSD terminal driver not only handles "crt rubout"
correctly (i.e., it erases *all* the spaces generated by a tab), but it can
also handle rubout in the style of DEC OSes on hardcopy terminals, so it
encourages use of non-printing characters.

A couple of even better questions are:

	1) Why was '#' chosen both as the default erase character and
	   the preprocessor line flag for C?

	2) Why were the '#' and '@' characters used as editing characters,
	   other than nostalgia for Multics (which used lots of weird IBM
	   2741 printing terminals over half-duplex lines, and couldn't
	   do much better), when the DEC OSes (which supported full-duplex
	   ASCII terminals) *already* had a relatively sane convention
	   for handling rubout both on printing terminals and CRTs?

	Guy Harris



More information about the Comp.unix mailing list