Bug (or wierd behavior) In C Shell

Steve Simmons simmons at applga.uucp
Fri Jun 10 04:12:50 AEST 1988


Consider the following two scripts:

       OK                        Buggy
   #!/bin/csh           | #!/bin/csh
   if ( 1 ) then        | if ( 0 ) then
   cat << HERE          | cat << HERE
   else                 | else
   HERE                 | HERE
   else                 | else
   echo There           | echo There
   endif                | endif

Executing OK is fine -- it echos 'else'.  Executing Buggy gives an error
	HERE: Command not found.
It appears that in Buggy it is disregarding the here document *even though
it is syntactically correct*.

The Bourne and Korn shell equivalents to this script work fine, ie, buggy.sh
echos 'There'.  Bug in the C shell?  Or a wierdness of syntax that I can
use to convince people Korn is better?  :-)

-- 
+- Steve Simmons            UNIX Systems Mgr.         Schlumberger CAD/CAM -+
+  simmons at applga.uucp                              ...umix!applga!simmons  +
+- "Opinions expressed are all my own, etc, etc, etc, etc, etc, etc, etc." -+



More information about the Comp.unix.questions mailing list