Disabling Caps-Lock in X

I never use Caps-Lock for its intended purpose when typing, so it only exists to be annoying as far as I'm concerned. So here's a handy configuration-file-free method to disable it in X — add this to e.g. your .bashrc file:

if [[ "xterm" == $TERM && -x `which xmodmap` ]]; then echo "remove Lock = Caps_Lock" | xmodmap -; fi;

Sorted.