Path: utzoo!utgpu!watserv1!ria!rrivax.rri.uwo.ca!lrb From: lrb@rrivax.rri.uwo.ca (Lance R. Bailey) Newsgroups: comp.unix.shell Subject: Re: How to do mv *.xyz *.abc in shell script?? Summary: TYPO Message-ID: <977@ria.ccs.uwo.ca> Date: 7 Sep 90 13:26:19 GMT References: <5569@minyos.xx.rmit.oz> <975@ria.ccs.uwo.ca> Sender: news@ria.ccs.uwo.ca Reply-To: lrb@rrivax.rri.uwo.ca Organization: Robarts Research Institute -- London Canada Earth Lines: 16 News-Software: VAX/VMS VNEWS 1.3-4 In article <975@ria.ccs.uwo.ca>, lrb@rrivax.rri.uwo.ca (Lance R. Bailey) writes... > ># changing *foo to *bar >for i in *foo >do > j=`echo $i | sed -e 's/foo/bar/'` should read j=`echo $i | sed -e 's/foo$/bar/'` ^<---missing dollar sign to bind to end of string > mv $i $j >done _________________________________ Lance R. Bailey, Systems Manager | Robarts Research Institute email: lrb@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