-   Linux - General (
-   -   basename counterpart? (

glass 08-24-2002 12:06 AM

basename counterpart?
I'm trying to change a relatively large group of files' extensions. I can remove the current extensions with basename I think, but I need a counterpart to add the correct extension.

Hko 08-24-2002 07:11 AM

One way to do this:

Change to the directory where your to-be-renamed files are, and enter (in bash):

for i in *.$OLDEXT ; do mv "$i" "${i%.*}.$NEWEXT" ; done

Where you should change the extensions ("cc" and "cpp") to your own needs of course.

All times are GMT -5. The time now is 09:14 PM.