[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



> 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.