Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!adiron!ashesh From: ashesh@adiron.UUCP (Patel) Newsgroups: comp.unix.wizards Subject: Re: interesting csh bug Summary: Interesting CSH bug Keywords: the answer! Message-ID: <422@adiron.UUCP> Date: 6 Oct 89 18:34:43 GMT References: <9557@cadnetix.COM> <9563@cadnetix.COM> Distribution: usa Organization: PAR Technology, New Hartford, NY Lines: 44 In article <9563@cadnetix.COM>, rusty@cadnetix.COM (Rusty Carruth) writes: > In article <9557@cadnetix.COM> rusty@cadnetix.COM (Rusty Carruth) (thats me) > writes: > > > >However, I had been noticing some strange behavior, and finally > >got the time to track it down. Here is a small test case > >which embodies my findings: > > > .... > >#! /bin/csh > .... > > if( $SET == "set1" ) then > .... > > if( 3 != 3) then > > Well, I've already gotten mail from 2 people pointing out that > csh will fail to 'do the good thing' if you use "if(", but > it will work just fine and dandy if you use "if (". And > they were right, it works just great if you have a space > after the if. My thanks to David C Lawrence > and Bradley White for pointing this out. > > Thus ends the saga. If any wizards out there want a copy of my > un-news script, email me (it takes news articles which have been saved > away and un-shars or un-uudecodes them into another location, and handles > both multiple-part articles and single articles. It does not as > of yet handle patches, and probably never will). > ---------- > Rusty Carruth UUCP:{uunet,boulder}!cadnetix!rusty DOMAIN: rusty@cadnetix.com > Daisy/Cadnetix Corp. (303) 444-8075\ 5775 Flatiron Pkwy. \ Boulder, Co 80301 > Radio: N7IKQ 'home': P.O.B. 461 \ Lafayette, CO 80026 Interesting........ I never had that problem and I would assume that something else could be wrong in the shell script that you wrote. My suggestion would be to "debug" the script using -xv flags; i.e. the first line of the program would be #!/bin/csh -xv (4.3 BSD manual discusses this flags.) Also I think that in the example above it might be appropriate to use ' ~= ' for pattern matching instead of ' == ' which is used in expressions. Chap-7 in the text-book about C-shell discusses this.