Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!icdoc!syma!andy From: andy@syma.sussex.ac.uk (Andy Clews) Newsgroups: comp.unix.questions Subject: Re: Cshell question: taking wordlists as a single string Message-ID: <3269@syma.sussex.ac.uk> Date: 16 Aug 90 13:00:47 GMT References: <3251@syma.sussex.ac.uk> Organization: University of Sussex Lines: 33 In article <3251@syma.sussex.ac.uk>, I wrote: > > Basically, then, can Cshell cope with word-lists as single arguments, or > must I write a C program to do the job (or try sh or ksh?) > The solution was staring me in the face and I didn't see it until Jay Plett sent me this solution: % xxx "a b c" d e f a b c d e f % cat xxx #! /bin/csh -f while ( $#argv ) echo $1 shift end So you must use a while loop rather than a foreach loop. So obvious now I look at it. *sigh* Thanks to Jay for the enlightenment. -- Andy Clews, Computing Service, Univ. of Sussex, Brighton BN1 9QN, England JANET: andy@syma.sussex.ac.uk BITNET: andy%syma.sussex.ac.uk@uk.ac