"Mikkel L. Ellertson" <[EMAIL PROTECTED]> writes:

> On Fri, 2 Feb 2001, christopher j bottaro wrote:
> 
> > hello,
> > is there a convienient way to change all .cc files in a dir to .cpp files?
> > rather, copy *.cc to *.cpp?  perhaps a shell script of some piped commands?
> >
> > thanks for the help,
> > christopher
> >
> One way is to use Midnight Commander (mc).  Change to the directory with
> the .cc files.  Hit the number pad +.  For a matching pattern, use *.cc.
> Hit F6 (move).  Change the move target to *.cpp.
> 
> Unless you need to do this often, it isn't worth writing a script.
> Mikkel


Since a shell script is really no more than an extended command line
you could do (in a single directory) from the command line:

^^^^^^^^^^^^
for file  in `ls *.cc`    ## <= note back tics (`...`)
do
mv $file `echo $file|sed 's/\.cc/.cpp/'`  # <=Note back tics (`...`)
done 

^^^^^^^^^^^
If running bash shell you should be able to say:

        touch file1.cc file2.cc file3.cc

Paste the above command (between the ^^^^^^^^^^ marks)
to your command line and execute it to test it out.


Then say `ls *.cpp'  to see the results.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to