If you are new to linux, don't you think trying to write a shell script to download and install a program and any dependencies it may need, is a tad ambitious?
Have you ever written a shell script before?
There are some great guides here:
http://www.tldp.org/guides.html