From mboxrd@z Thu Jan 1 00:00:00 1970 From: norman@oclsc.org (Norman Wilson) Date: Mon, 12 Sep 2016 08:56:56 -0400 Subject: [TUHS] Shell control through external commands Message-ID: <1473685021.9119.for-standards-violators@oclsc.org> Joerg Schilling: The colon was introduced by AT&T around 1983. It was used for Bourne Shell scripts. Some of these scripts made it into SVr4 and caused problems with non-Bourne compatible other shells. ==== Interesting. I never knew of that convention. I remember seeing shell scripts with a : at the front, but thought that was just to make sure the first character wasn't # even if the script began with a comment. Since some here had never heard of the #-means-csh convention, I should perhaps explain about :. In pre-Bourne shells that used the simple external control-flow mechanisms that I think were discussed here a few months ago, : was used to mark a label: goto(1) would seek to the beginning of its standard input, then read until it encountered a line of the form : label with the desired label, then exit with the seek pointer at the first character of the following line. : was a no-op command; I forget whether it was implemented within the shell or externally. Either way, that made it useful as a comment character, but somewhat clumsy: it was just a command, with no special parsing rules attached. A comment using : had to begin at a command boundary, and its arguments were parsed in the normal way: rm -rf * : you don't want to do this was probably not what you wanted, instead you had to type rm -rf * ; : "you don't want to do this" or the like. csh used # as a comment character from the beginning. Bourne adopted it too. Norman Wilson Toronto ON