🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1099

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

#1099
From: Jason Molenda
Date: Fri, 07 Sep 1990 15:30
19 lines
945 bytes
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
Technical Details
Message-ID: <1990Sep7.153055.6629@msi.umn.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ucsd!tut.cis.ohio-state.edu!uc!cs.umn.edu!msi-s0.msi.umn.edu!molenda
References: <5569@minyos.xx.rmit.oz> <975@ria.ccs.uwo.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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