Yesterday, I recieved my first 'Lava Lamp'. There's (apparently) long been a tradition in Cap One's IT department of giving a Lava Lamp to anyone who makes a particularly memorable schoolboy error. Mine was a pretty special one – launching the new Capital One Mortgages&Insurance website (planned and delivered in a ridiculously short space of time, helped in no small part by myself), I'd written a really noddy script to ssh to a series of boxes and create some new directories, touch some files and populate them with specific variables. I copied the same script I'd used for the SIT implementation, and put a nice big comment at the top saying 'PRODUCTION VERSION' for clearness.
Now, the first time we ran that script – we ran it on a rather special little Solaris box we keep sat in a DMZ with a bunch of routing rules to get at web server boxes. My script killed it in under a minute – and all it was doing was ssh'ing to 2 other boxes? It had run fine in SIT, no problem. One lengthy wander down to the server room and a reboot later – another attempt. We'd thought it must have been someone else killing the box, but no – same result. Third time, we looked to see what the script was doing – remarkably, my script spiralling out of control, forking processes left right and centre. Another reboot – and before running the script again, a quick check to see what it was doing. The first lines read:
#!/usr/bin/ksh
***********************
* PRODUCTION VERSION *
***********************
…
Anyone who knows Unix should spot my utterly ridiculous error – asterisks! I'm not sure why I used them, but it quickly became apparent why this script was doing what it was doing: executing everything in the current directory, 48 times over… Oooops. Removing these lines made the script run fine – but earned me a Lava Lamp. :)


