Home | RecentChanges | Preferences

Suppose you have these files:

  133_3373.JPG.jpg  133_3377.JPG.jpg  133_3381.JPG.jpg  133_3385.JPG.jpg
  133_3374.JPG.jpg  133_3378.JPG.jpg  133_3382.JPG.jpg
  133_3375.JPG.jpg  133_3379.JPG.jpg  133_3383.JPG.jpg
  133_3376.JPG.jpg  133_3380.JPG.jpg  133_3384.JPG.jpg

You want to rename them to end with just ".jpg".

Your code looks like this:

  foreach i ( *.JPG.jpg )
    mv $i `basename $i .JPG.jpg`.jpg

See Also: ForLoop

Home | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited May 30, 2004 22:20 (diff)