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

Lance R. Bailey lrb at rrivax.rri.uwo.ca
Fri Sep 7 16:53:50 AEST 1990


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
done
_________________________________
Lance R. Bailey, Systems Manager | Robarts Research Institute
email: lrb at rri.uwo.ca            | Clinical Trials Resources Group
  vox: 519-663-3787 ext. 4108    | P.O. Box 5015, 100 Perth Dr.
  fax: 519-663-3789              | London, Canada N6A 5K8



More information about the Comp.unix.shell mailing list