delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

I want to duplicate all files ending with ".JPG" back into the same directory and rename the copies by changing the name suffix from ".JPG" to "_gray.JPG". Tips?
Thanks
Ken


I'm plodding my way through UNIX for Mac OS X and have come up against something that seems like it should be pretty easy, trouble is, I can't seem to conjure the correct unix incantation. Could someone show me how to do the following?
I want to duplicate all files ending with ".JPG" back into the same directory and rename the copies by changing the name suffix from ".JPG" to "_gray.JPG". Tips?
Thanks
Ken

TOP

Déjà vu.
Code:
  1. for i in *.JPG; do
  2.   cp $i ${i\%.JPG}_gray.JPG
  3. done
Copy Code




I want to duplicate all files ending with ".JPG" back into the same directory and rename the copies by changing the name suffix from ".JPG" to "_gray.JPG". Tips?
Thanks
Ken

TOP

Back Forum