Unix stuff. Most of you will not care. On the subject of dorkiness, I would like to add that my previous post was delayed by over two hours from when I originally set out to post it. Why, you may ask? Do you see how every thumbnail is a link to the full sized version of the image? Rather than typing that all up manually, I made a script to generate all of that html for any directory full of images (as long as appropriate thumbnail images also exist).
This ended up being more work than I thought, because I wanted it to put the full path to the images in the html with one easy command, and this is made annoying by the fact that "/" is treated specially by sed, which is what I was using to do my search and replace. I ended up having to clean up the URLs with sed in order to use sed AGAIN to place them in the appropriate place in my html code. I ended up having to use statements like
sed 's/\//\\\//g' which starts to look suspiciously like line noise. For non unix-types, yes, that actually does something useful, and isn't just the result of me pounding my head on the keyboard.
I probably could have done the whole damn thing more efficiently. This is clear now that I've stepped away from the problem. But my solution works, and the extra complexity caused by me solving the problem in a perhaps kludgy way isn't relevant to the user. That's part of what happens when you take an existing program (my original, simpler script) and patch it up to do something more than it originally did, rather than starting fresh.
In any case, I had to learn a lot about shell scripting, sed (a damned useful tool) and bash command substitution. So it was useful.
If you care, which you probably don't, my complete script and further discussion is
( behind this cut. )God damn I love using a *nix environment. I'm worthless at things like making X or wireless work properly, but once I am given a functioning system, it's amazing how much I can do.
Oh, and the great irony of all of this is that I spent a couple of hours writing this script (because I had to learn a lot of new things and fix a lot of annoying bugs) and have spent a further half hour making this write up, when I could have just made the desired html manually in a couple of minutes.
But now I have a script to do that for me! And by the time I've used the script about 24 times to post lists of images, I will have finally BROKEN EVEN on the time I've invested. But it's ok, because I have had a fun and educational evening.
Also... holy shit, taking a nap mid-day and having coffee in the afternoon was a bad call.