I have a directory full of files (~150) that have names of the form
XXXX.jpg.gif which I want to rename so that they are of the form XXXX.gif
(where XXXX are numbers from 0001-0150) but I can't figure out how to do
it all at once, w/o having to rename them individually.
My first thought was do it like DOS: mv ????.jpg.gif ????.gif but that
resulted in a "No Match" message. "mv *.jpg.gif *.gif" resulted in files
like XXXX.jpg.gif.gif. The basename function seems to provide most of what
I need, but I don't know enough programming to figure out how to write a
shell script using it. I used basename with foreach and produced a file like:
0001
0002
0003
etc., but I don't know what to do with that file, if anything. Any
suggestions? (I'm quite sure I've made this into a much more difficult
problem than it is, but everything I know about Unix I learned from the
man pages!)
Thanks for any help. -- Tom
--
"Laugh and the world laughs with you; Thomas A. La Porte