Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wivax.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!wivax!evans From: evans@wivax.UUCP (Barry Evans) Newsgroups: net.unix-wizards Subject: Re: re: csh question Message-ID: <19239@wivax.UUCP> Date: Wed, 29-Feb-84 12:07:50 EST Article-I.D.: wivax.19239 Posted: Wed Feb 29 12:07:50 1984 Date-Received: Fri, 2-Mar-84 00:21:50 EST References: <2640@fortune.UUCP> Organization: Wang Institute, Tyngsboro, Ma. 01879 Lines: 31 Someone posted an article stating they had a problem with the following csh script, and someone else posted a followup stating there was an incorrect number of endif's. Not so. Removing one of the endif's is a hack, which just happens to work. I'm convinced that there is a bug in Csh, and that the logic in the script is correct. Reason being, if you include a whitespace after the if's, then the following script works as it is supposed to. I haven't seen anything in the documentation saying that you must include white-spaces though. Also, in expressions, you must include spaces before and after the conditions, which the documentation doesn't mention either, but for these you will get error messages. #! /bin/csh { set x=1 x=1; if($x == 1) then if(x == 1){ set y=2 y=2; else }else{ if($y == 2) then if(y == 2){ echo "line 1" printf("line 1"); else }else{ echo "line 2" printf("line 2"); endif } echo "shouldn't get here" printf("shouldn't get here"); endif } echo "finished" printf("finished"); } -barry -- Barry Evans {apollo, cadmus, decvax, linus}!wivax!evans Wang Institute (617) 649-9731 x383