home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / question / 15073 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.1 KB

  1. Path: sparky!uunet!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Bug (?) in csh
  5. Date: 31 Dec 1992 04:06:31 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 16
  8. Distribution: world
  9. Message-ID: <1htrk7INNf8k@early-bird.think.com>
  10. References: <1htk6fINN9hn@news.umbc.edu>
  11. NNTP-Posting-Host: gandalf.think.com
  12.  
  13. In article <1htk6fINN9hn@news.umbc.edu> engel@umbc8.umbc.edu (Mr. Joshua F. Engel) writes:
  14. >That is incorrect; there should be no output because the program
  15. >should not enter the inside of the first if statement.  Between
  16. >this and other experiments, I conclude that csh matches ifs
  17. >not with the corresponding endif but rather with the first
  18. >endif.
  19.  
  20. You've stumbled onto one of csh's many bugs, although it's not the bug you
  21. think it is.  Add a space between the "if" and the "(" and you'll get the
  22. output you expect.  Csh's lexer is extremely broken.  When you're forced to
  23. write csh scripts, it usually pays to be extremely liberal with whitespace.
  24. -- 
  25. Barry Margolin
  26. System Manager, Thinking Machines Corp.
  27.  
  28. barmar@think.com          {uunet,harvard}!think!barmar
  29.