[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] How to change the extension of many files at a time



Hi

 I think this will work. 

#cp *.cc *.cpp
#rm *.cc

 Don't flame me if I am wrong. This is an opinion.

  Bye
   Shridhar

On Mon, 17 Jan 2000, Rohit wrote:

> > Rakesh Tiwari forced the electrons to say:
> > > yes u can do that with the command
> > > # mv *.cc *.cpp <Enter>
> > Hi Rakesh,
> > Please test the solutions you propose before posting here. Do you think this
> > will work? For mv, if there are more that two command line arguments (apart
> > from the switches), then the last one has to be a directory.
> 
> Binand, bachche ko maaf kar do. DOS shell allows this. So he might have
> been tempted to jump the gun. I remember trying it myself, for the first
> time. And of course, it didn't work on TULSI.
> 
> > One method is to run the script (in bash):
> > for i in *cc; do base=$(basename $i .cc); newname=${base}.cpp; mv $i $newname; done
> 
> Barabar.

--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.