here is a good starting tutorial on bash scripting:
http://www.panix.com/~elflord/unix/bash-tute.html

feel free to add other helpful links to this post.