Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!sun-spots-request From: harp@pkg.mcc.com (Christopher North-Keys) Newsgroups: comp.sys.sun Subject: Re: nested ifs' in csh dont work? Keywords: Software Message-ID: <8576@brazos.Rice.edu> Date: 6 Jun 90 11:27:37 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 40 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n193, Replies: v9n193 v9n196 X-Sun-Spots-Digest: Volume 9, Issue 201, message 1 They do indeed work, if the "if" in each instance in immediately followed by a space, as already noted. The only distinct oddness I've noted in Csh programs is that aliases don't work placed in the format: if (cond) alias where instead the following *must* be used: if (cond) then alias ... This type of thing also occurs in local variable setting. There must be spaces on *both* sides of the "=", or neither. In contrast "=" is *not* used in setenv commands. It's worth noting that all local variables are vectors (lists), and can easily be used as local stacks. Nesting of if/then/else/endif, switch/case/breaksw/default/endsw, while/break/end, etc., all works as expected. The last person I found having trouble was trying to use "break"/"end" in "switch", instead of the required "breaksw"/"endsw". He enclosed the entire switch in a "while 1 / end" loop to get the misbegotten "break"/"end"s to do what he wanted. This is called not reading the manual, folks. I find the C shell flow constructs much more obvious than I do the Bourne. The keyword "breaksw" is rather more intuitive than ";;". But then, I'm a C(++) programmer, and such were also the C shell authors :-). Someone needs to write a nice, new (PD) shell from scratch, of course. None of the existing shells are what I'd call either "consistent", or "elegant" (personal opinion of: sh, ksh, csh, bash, tcsh). In particular, none of them support the loading of additional object modules at runtime, nor state-dumping or the like (like GNUemacs) to reduce startup time. Their command sets all require bizarre parsing (contrast to languages like Lisp and Forth), and all have peculiarities. ------------------------------------/\---------------------------------------- Seo: Harp[@Mcc.Com] / \/\ ^*^ Christopher North-Keys Tha mi gu trang a'cluich. / \ \ Assoc. Systems Analyst, MCC --------------------------------(disclaimer)----------------------------------