Xref: utzoo comp.unix.questions:7574 comp.unix.wizards:9325 Path: utzoo!attcan!uunet!husc6!mailrus!umix!metavax!oxtrap!lokkur!applga!simmons From: simmons@applga.uucp (Steve Simmons) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Bug (or wierd behavior) In C Shell Keywords: here script syntax oops Message-ID: <172@applga.UUCP> Date: 9 Jun 88 18:12:50 GMT Organization: Schlumberger CAD/CAM, Ann Arbor, MI Lines: 25 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@applga.uucp ...umix!applga!simmons + +- "Opinions expressed are all my own, etc, etc, etc, etc, etc, etc, etc." -+