Skip to content

bish bosh bash…

July 19, 2008

A friend gave me a CD full of jpg images… only the “.jpg” extensions were missing from the filenames. The macbook had no problems in viewing the files, but windows wasn’t having any of it unless I used Open As. And, of course, without any extension, I couldn’t “Always use this application for this file type” so I’d have to open each one of the eighty-odd images individually. Meh.

I’ve actually downloaded and used a freeware Bulk Rename Utility in Windows before, but it was really clunky. What I really needed was a script, and an OS that gave me instant access to a scripting language.

(Yes, this is another pro-mac post)

So, here is it, in all it’s glory. Man, I *love* it when a plan comes together…

#!/usr/bin/env bash

for thing in “$@”
mv ${thing} ${thing}.jpg

then all that was needed was a quick

./ $(ls)

and I was done. (And, yes, it does rename to…)


me: Oh, btw, [a friend] has given us a CD of photos.

her: Yes, I’ve had a look at them. But I had to rename all the files to .jpg.

me: What? But I did that already! And put them [in the right place]!

her: Oh.


Comments are closed.

%d bloggers like this: