Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!3comvax!bridge2!mbt From: mbt@bridge2.3Com.Com (Brad Turner) Newsgroups: comp.unix.questions Subject: csh weirdness Keywords: foreach end ; ls Message-ID: <315@bridge2.3Com.Com> Date: 8 Feb 89 23:20:34 GMT Organization: 3Com Corp., Mt. View, CA Lines: 27 Something strange happened to me today while renameing some files and I can't explain it so maybe some of you can. Here goes I had 10 files named zoo-1 zoo-2 zoo-3 .... zoo-08 zoo-09 zoo-10 and I wanted to rename them so that a shell expansion of zoo* would have them aplhabetized so I did the following: % foreach i ( 1 2 3 4 5 6 7 8 9 ) > mv zoo-$i zoo-0$i > end;ls > end When the loop was executed it did the first mv then an ls of my current directory, then the second mv and another ls..... after the last ls I got the following "end: Not in while/foreach." I was under the impression that above would execute the loop, then execute an ls. 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" If figured what the hell and entered the second end. What caused this? -brad- -- v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v Brad Turner 1330 Ashleybrook Ln. (919) 768-2097 | I speak for myself 3Com Corp. Winston-Salem, NC 27103 mbt@bridge2 | NOT for my employer.