Couple of scripts I've used with bash.