Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: csh weirdness Keywords: foreach end ; ls Message-ID: <2024@solo9.cs.vu.nl> Date: 9 Feb 89 19:41:42 GMT References: <315@bridge2.3Com.Com> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 24 mbt@bridge2.3Com.Com (Brad Turner) writes: \% foreach i ( 1 2 3 4 5 6 7 8 9 ) \> mv zoo-$i zoo-0$i \> end;ls \> end \... I had no intention \of putting in the last end statement, but when the shell gave me the \secondary prompt after I had already entered "end;ls" I figured what the \hell and entered the second end. What caused this? Welcome to csh! It's just the way csh works: confusing syntax, buggy parser. Beware if you want to use anything more difficult than: alias ll ls -la set history = 20 The `end' statement must either appear alone on a line, or followed by a semicolon PRECEDED BY WHITESPACE! Everything after the `;' (on the same line) is PART OF THE LOOP! Now go home, switch on your turntable and put on some record called `Crying'. -- "I love it |Maarten Litmaath @ VU Amsterdam: when a plan comes together." |maart@cs.vu.nl, mcvax!botter!maart