Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix Subject: Re: Comment lines in the Bourne shell Message-ID: <2288@sun.uucp> Date: Mon, 10-Jun-85 17:01:10 EDT Article-I.D.: sun.2288 Posted: Mon Jun 10 17:01:10 1985 Date-Received: Fri, 14-Jun-85 05:04:14 EDT References: <1194@uwmacc.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 17 > 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 isn't really a comment; it's a command that doesn't do anything (however, it returns "true", so "while :" is equivalent to "while true" - and faster, since ":" is built-in). The 4.xBSD Bourne shell and the System Bourne shell also support real comments; a "#" on a command line causes the rest of the line to be ignored by the shell. Guy Harris