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