If you're not yet comfortable with writing scripts on Unix and Linux systems, this post might get you off to a healthy start. Creating a script on a Unix or Linux system can be dead easy or ...
I'm posting this here because OS X is my main unix system, though I also use some linux stuff (synology and a ubuntu virtual machine in my mac). I've dabbled with unix off and on for more than 20 ...