How to do mv *.xyz *.abc in shell script??

Jason Molenda molenda at msi.umn.edu
Sat Sep 8 01:30:55 AEST 1990


lrb at rrivax.rri.uwo.ca (Lance R. Bailey) writes:

>In article <5569 at minyos.xx.rmit.oz>, rcoahk at 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 at s1.msi.umn.edu



More information about the Comp.unix.shell mailing list