An Introduction to Linux Shell Scripting for DBAs
http://www.oracle.com/technetwork/articles/saternos-scripting-088882.html

You can find almost any coding example using Google. It may take some time to learn how to search in Google and find the right phrases and keywords. However, it often works to simply type the question you have in mind in the Google search box.