Bourne Shell Comments Problem

Miles O'Neal meo at stiatl.UUCP
Thu Sep 22 23:04:34 AEST 1988


In article <292 at dsacng1.UUCP>, nab1382 at dsacng1.UUCP (Dick Hauser) writes:
> The comment indicator (i.e #) is
> in position 1 of the first record of the file.  The comment line
> was followed by a read command for a varibale.  When the shell  
> was executed using "sh -x shellname", everything worked.  But
> when the shell is executed, and execution is not traced, an error
> message "read not found" is displayed.

A comment indicator in column1, line 1, indicates the script is
a csh script instead of sh. Bourne shell (sh) scripts with comments
at the top require a blank line (or anything other than a comment)
on the first line. Since read is built into sh, and csh uses a
different mechanism for reading input, csh could not find a read
program in your path to invoke.

As the above implies, any script that does not have the comment starting
in column 1, line 1, will default to sh.

I am not familiar with ksh (barbarian that I am), so I don't know how
that fits into the scheme of things. I also don't know what happens
on System V implementations without a vendor-added or PD csh.



More information about the Comp.unix.questions mailing list