Comment lines in the Bourne shell
Andy Merritt
apm at iclbra.UUCP
Fri Jun 14 09:02:09 AEST 1985
> 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 <name> | lpr
>
> produces a message referring to the pipe, even though the whole
> line is commented out. What am I missing?
>
> --
> Jeff Percival ...!uwvax!uwmacc!jwp
According to the SysV documentation I have, ':' is a special command for which
the manual says
: no effect; the command does nothing. A zero exit code is returned.
This implies that the effect is not to ignore the rest of the line as you
expected, but to take as arguments anything up to a normal terminator and
then do nothing with them. The | is met in this case, and nothing is in the
input for the lpr.
I guess this must be what is happening on the 2.8BSD system also.
Andy
/^^^\
( o o )
--w---U---w-- UUCP: ...!ukc!stc!iclbra!apm
"Wot, no news?" MAIL: Andrew Merritt, ICL, Lovelace Rd, Bracknell, Berkshire
More information about the Comp.unix
mailing list