Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site lzwi.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!lzwi!psc From: psc@lzwi.UUCP (Paul S. R. Chisholm) Newsgroups: net.unix Subject: Re: Comment lines in the Bourne shell Message-ID: <176@lzwi.UUCP> Date: Thu, 13-Jun-85 14:17:48 EDT Article-I.D.: lzwi.176 Posted: Thu Jun 13 14:17:48 1985 Date-Received: Fri, 14-Jun-85 04:56:28 EDT References: <1194@uwmacc.UUCP> Distribution: net Organization: AT&T-IS Enhanced Network Services Lines: 32 Summary: ':' isn't a comment *character*, it's a comment *command*! < Smokey the Bar says, "Help stamp out software pirates" [squish!] > In article <1194@uwmacc.UUCP>, jwp@uwmacc.UUCP writes: > I've noticed that on my system (2.8BSD) the Bourne shell > comment character doesn't do what I expected. The shell > still looks at some characters on the line, even though > the line is commented out. For example, the comment > : to use this file type | lpr > produces a message referring to the pipe, even though the whole > line is commented out. What am I missing? The colon is *NOT* a comment character. Instead, it's a builtin command, like cd, which happens to do nothing. Filenames are expanded, and quotes must be matched. (The favorite Unix(tm) trivia question of a friend of mine, mtgzz!ecl, is, "What does the following do?" : " This is a comment nroff -mm lots-o-stuff : " Gee, that nroff ran fast! This is one colon command, whose first argument goes from the first to the second quote, inclusive.) More recent versions of the Bourne shell *do* have a comment character: "A word beginning with # causes that word and all the following characters up to a new-line to be ignored." --- Unix is a trademark of some entity withing AT&T, but I'm not sure what its name is this week. "AT&T's Bell Laboratories", maybe?? -- -Paul S. R. Chisholm The above opinions are my own, {pegasus,vax135}!lzwi!psc not necessarily those of any {mtgzz,ihnp4}!lznv!psc telecommunications company.