[TUHS] Bourne shell and comments

Arthur Krewat krewat at kilonet.net
Thu Apr 20 06:35:40 AEST 2017

This is all very interesting. Back when I was in high school, I 
exploited a daemon on the PDP-10 we used. MIC. It allowed you to 
basically run a "shell script" using a PTY as yourself, and it would 
generate a log, and you could peruse it at your leisure. The exploit had 
to do with the fact that PTYs had special privileges because of some 
custom security alterations  the consulting firm made to TOPS-10.

After the consulting firm got wind of what I did, they asked me to write 
a replacement that was more secure. While the original MIC had a lot of 
functionality in it, including labels like GOTHERE: (not the trailing 
colon), and it was used to compile the monitor (TOPS-10), they just 
needed something quick-and-dirty that students could use that wouldn't 
open up a security hole. I basically just forced the script into the 
terminals input buffer and let the monitor execute it line-by-line, 
instead of using a PTY.

So while I was creating this new MIC, I figured why not put the colon at 
the beginning of the line, it was easier to find on-the-fly.

Imagine my surprise when I got into DOS a year or two later and they 
used leading colons for labels in batch files.

Not having any access whatsoever to any flavor of UNIX at the time, this 
is the first I've heard that leading colons were used for labels outside 
of DOS and my MIC-lite :)

On 4/19/2017 2:36 PM, Stephen Kitt wrote:
> On Tue, 18 Apr 2017 15:45:36 -0600, Grant Taylor <gtaylor at tnetconsulting.net>
> wrote:
>> On 04/18/2017 02:51 PM, Ron Natalie wrote:
>>> Was also the label for goto.
>> Does that mean that the (so called) comment was really an (unused) label?
> Not Unix, but on DOS (on PCs) this was a common trick — it was especially
> appreciated because : as a comment prefix (often doubled, so it couldn’t be
> mistaken for a goto label) was faster to process than the official REM (which
> was a command which had to be executed).
> Regards,
> Stephen

More information about the TUHS mailing list