Line at a time scripts in csh

Guy Harris guy at auspex.UUCP
Thu Jan 26 07:09:34 AEST 1989


>I just wrote the script as given, and tried it with sh, ksh, and csh, and it
>worked for all three.

The "csh" on your system must be something other than the C shell, then,
because the C shell is quite different from the Bourne shell, and it
complained as soon as it saw

	ifs_def=$IFS

because it said that IFS was an undefined variable; when I defined it,
it gave

	ifs_def=: Command not found.

instead.  The way you set shell variables is different in the C shell,
so it didn't like "ifs_def=$IFS".

Most non-trivial Bourne shell scripts probably don't work at all if you
run them under the C shell. 

(Obligatory clarification, to ward off "Wrong! See, here's *my* trick
for doing that" postings: Most non-trivial Bourne shell scripts probably
don't work at all under the C shell unless you do a Larry Wall-style
"ooops, wrong shell, I'll feed myself to 'sh'" trick, or have some other
trick, perhaps along the lines of those programs that represented valid
C, Pascal, and FORTRAN source through clever use of the three languages'
comment conventions.)



More information about the Comp.unix.questions mailing list