Xref: utzoo comp.unix.questions:7596 comp.unix.wizards:9370 Path: utzoo!attcan!uunet!husc6!rutgers!sunybcs!ugfailau From: ugfailau@sunybcs.UUCP (Fai Lau) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Bug (or wierd behavior) In C Shell Keywords: here script syntax oops Message-ID: <11961@sunybcs.UUCP> Date: 14 Jun 88 21:20:27 GMT References: <172@applga.UUCP> Reply-To: ugfailau@sunybcs.UUCP (Fai Lau) Organization: SUNY/Buffalo Computer Science Lines: 39 In article <172@applga.UUCP> simmons@applga.uucp (Steve Simmons) writes: >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. .... >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? :-) Try #!/bin/csh if (0) then cat << HETE; else; HERE else echo There endif I don't particularly like writing shell script for C shell for the very reason that I can never tell what kind of "weirdness" would pop up where I least expected it. Oh, BTW, in my personal opinion, I would say that the Korn shell is "somewhat" better than the C shell. Fai Lau SUNY at Buffalo (The Arctic Wonderland) UU: ..{rutgers,ames}!sunybcs!ugfailau BI: ugfailau@sunybcs INT: ugfailau@joey.cs.buffalo.EDU