Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ucsd!tut.cis.ohio-state.edu!uc!cs.umn.edu!msi-s0.msi.umn.edu!molenda From: molenda@msi.umn.edu (Jason Molenda) Newsgroups: comp.unix.shell Subject: Re: How to do mv *.xyz *.abc in shell script?? Message-ID: <1990Sep7.153055.6629@msi.umn.edu> Date: 7 Sep 90 15:30:55 GMT References: <5569@minyos.xx.rmit.oz> <975@ria.ccs.uwo.ca> Organization: Minnesota Supercomputer Institute Lines: 19 lrb@rrivax.rri.uwo.ca (Lance R. Bailey) writes: >In article <5569@minyos.xx.rmit.oz>, rcoahk@chudich.co.rmit.oz (Alvaro Hui Kau) writes... >>So, Is there anyone out there can help me on this problem? ># changing *foo to *bar >for i in *foo >do > j=`echo $i | sed -e 's/foo/bar/'` > mv $i $j in csh it's even easier foreach i ( *foo ) mv $i {$i:r}.bar end Jason Molenda, Tech Support, Iris & News admin, Minnesota Supercomputer Inst molenda@s1.msi.umn.edu