home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3681 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.6 KB  |  50 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!cs.utexas.edu!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: C shell nested 'if' problem
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Aug28.134444.7751@news.eng.convex.com>
  8. Date: Fri, 28 Aug 1992 13:44:44 GMT
  9. Distribution: usa
  10. Reply-To: tchrist@convex.COM (Tom Christiansen)
  11. References: <=+dn+c-.darrell@netcom.com>
  12. Nntp-Posting-Host: pixel.convex.com
  13. Organization: Convex Computer Corporation, Colorado Springs, CO
  14. Keywords: csh
  15. X-Disclaimer: This message was written by a user at CONVEX Computer
  16.               Corp. The opinions expressed are those of the user and
  17.               not necessarily those of CONVEX.
  18. Lines: 30
  19.  
  20. From the keyboard of darrell@netcom.com (Darrell Sell):
  21. :I have a csh problem with nested if--else if--else statements.  The 
  22. :example below, gives the expected branching behavior, only if the parens
  23. :are removed from the first inner if expression.  With the parens
  24. :it gets confused if the first if expression is false.
  25. :
  26. :Books like "Unix in a Nutshell" or "The Unix C Shell Field Guide" or the
  27. :csh man page don't say anything on the topic.
  28.  
  29. Ah, but csh.whynot certainly does!
  30.  
  31.     COMMAND ORTHOGONALITY
  32.  
  33.     Stupid parsing bugs
  34.  
  35.         White space can matter:
  36.         if(expr)
  37.         may fail on some versions of csh, while
  38.         if (expr)
  39.         works!
  40.  
  41.  
  42. Maybe I should make this a periodic posting?
  43.  
  44. --tom
  45. -- 
  46.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  47.  
  48.         "AT&T -- anything better is illegal."
  49.           -- Keith Lofstrom, comp.unix.bsd, "AT&T sues BSDI" thread
  50.