If you would like to learn more about bash scripting (assuming you are using bash) I highly recommend this guide
Advanced Bash-Scripting Guide (tldp.org)

It's not designed with eye candy to look...