Here's the situation. I use a lot of JPEG images on my website. Before I put each image online, I generate a thumbnail image for each full size image. I do a whole directory of images at a time using imagemagick with a command like:
for img in *.jpg; do convert -resize 144x109 -interlace line -quality 85 $img t$img; done
So a thumbnail of each image is created with the same filename but a "t" prefix (to create them as new files). However, I'd rather continue to use a suffix of "_t" at the end of the filename to denote that its a thumbnail (when I started my site I used a Windows app to make all the thumbnails). For example, I'd like to have image1.jpg and its thumbnail image1_t.jpg
I've yet to find a way to do this with the Linux shell. What I've been doing for now is manually renaming all the files to remove the "t" prefix and add a "_t" suffix to the filename (i.e. timage1.jpg to image1_t.jpg ). Is there a way to automate this process with a shell script or by modifying the shell command above? Or am I crazy to think that there is an easy way to remove the first letter of a filename and insert two letters between the end of the filename and the extension?