[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



I am extreamly sorry for this wrong asnwer.
Out of sheer ignorance and absentmindness i have written this.
Please Excuse me for my error.

----- Original Message -----
From: Binand Raj S. <binand@xxxxxxxxxxxxxxxxxxxxx>
To: <linux-india@xxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, January 14, 2000 5:13 PM
Subject: 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.
>
> 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
>
> Binand
>
> >
> > > Hi everybody,
> > > I am having many files of .cc extension. Now I want to change the
> > > extension to .cpp. Can I do this at a time without going for each
file.
> > > TIA
> > > Ajit
>
> --
> #include <stdio.h>                                   | Binand Raj S.
> char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
> int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
> int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!
> --------------------------------------------------------------------
> 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.

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