Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!udel!princeton!phoenix!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul John Falstad) Newsgroups: comp.unix.shell Subject: Re: < Date: 23 Sep 90 01:26:43 GMT References: <12127@chaph.usc.edu> Sender: news@idunno.Princeton.EDU Distribution: usa Organization: Princeton University, Princeton, New Jersey Lines: 28 In article <12127@chaph.usc.edu> szeto@aludra.usc.edu (Johnny Szeto) writes: >[shakyamuni:54 :~] foreach i (*2) >? set g=`sed 's/\(.*\)2/\1/'<? $r[$b] >? fg` >? mv $i $g >? @ b++ >? end If you must do this with csh, try something like this: foreach i (*2) set g=`echo $r[$b] | sed 's/\(.*\)2/\1/'` mv $i $g @ b++ end I didn't bother to test it, but that's the general idea. Also, you may want to try the 'shift' builtin rather than that $r[$b], @ b++ stuff. >I am quite a novice in programming C-shell. Can someone give me some >guidance? So am I, and I'd like to keep it that way. :-) This is the silliest sketch I've ever been in!