1820708 Members
2764 Online
109627 Solutions
New Discussion юеВ

Re: Scripting book

 
SOLVED
Go to solution
Tony500
Advisor

Scripting book

Hi All,
I have very little knowledge of scripting in Unix. Could you guys tell me, in your opinion, what would be the BEST book for someone like me to learn scripting from?
Thanks everyone!
Tony500
You can usually find me at www.constantreader.net
11 REPLIES 11
Dario_1
Trusted Contributor
Solution

Re: Scripting book

Tony

I use UNIX Shell Programming by Stephen G. Kochan and Patrick H. Wood. I think is very good.

Regards,

DR
Steve Labar
Valued Contributor

Re: Scripting book

I use the same as Dario and I also use the UNIX C Shell Field Guide often for csh scripts.

Steve
Pete Randall
Outstanding Contributor

Re: Scripting book

"Unix Shells by Example", Ellie Quigley, Prentice Hall
http://www.phptr.com


Pete

Pete
S.K. Chan
Honored Contributor

Re: Scripting book

If you are a beginner, I personally find this book very useful .. "The Korn Shell - Linux and Unix Shell Programming" by Anatole Olczak.
http://www.amazon.com/exec/obidos/tg/detail/-/0201675234/qid=1050510102/sr=1-3/ref=sr_1_3/102-7602643-0235320?v=glance&s=books
You can browse some of the pages from the book.
Zafar A. Mohammed_1
Trusted Contributor

Re: Scripting book

All the above books are good. You can also check this
http://docs.hp.com/hpux/pdf/B2355-90046.pdf

http://docs.hp.com/hpux/pdf/B2355-90072.pdf

and if you can search on Google for "UNIX Unleashed", you can read free this book. Currently, I am at office and I don't have that complete free link. I'll post from home.

Thanks
Zafar
John Meissner
Esteemed Contributor

Re: Scripting book

I use 2 books

Korn Shell Programming by example
by Dennis OBrien & David Pitts

sed and awk
from Oreilly
by Dale dougherty and Arnold Robbins

I had never written scripts before I read these and I've learned very rapidly using them.
All paths lead to destiny
Tony500
Advisor

Re: Scripting book

Thanks Everyone! I'll check these out. oh and Zafar, that free link would be great, thanks!
Tony500
You can usually find me at www.constantreader.net
John Meissner
Esteemed Contributor

Re: Scripting book

I found the free link

http://pluto.phys.nwu.edu/~zhaoyj/learn/Unix-internet/toc.htm
All paths lead to destiny
Bill Hassell
Honored Contributor

Re: Scripting book

"The New KORN Shell" by Bolsky and Korn. (Note that one of the authors is David Korn) My dogeared copy is well used but it is not a tutorial, it is a reference text. Also useful is that it documents the various revisions of the Korn shell. It is also a good reference for HP's POSIX shell since POSIX shells are very similar (ksh, bash, etc).

But there is a big jump from the commands to the technique. While a good Korn shell book will show you a few examples on using certain commands and variables, technique is what makes for stable and reliable shell programs. I always start my shell programs with the courtesy loader directive (always a good idea for every interpreted language such as perl or ksh or csh, etc), followed by set -u (to avoid big errors later), then if the program will need tempfiles, I created a unique temp directory (not a tempfile). That way, I can store all my temp files in one spot and use the trap command to remove everything if the program is aborted or terminates normally. I will code variables as ALL CAPS so they stand out, functions are name with LeadingCaps, and I tenmd to code about 20-30% comments, mostly because I forget why I did something a certain way.

Other techniques are found simply by reading shell scripts and figuring out what is happening. Look at the Shelldorado website http://www.shelldorado.com/ which gives a lot of techniques for good scripting. Another resource for HP-UX scripts (that do useful things) is: ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/coolscripts/


Bill Hassell, sysadmin
Zafar A. Mohammed_1
Trusted Contributor

Re: Scripting book

John already given the correct link for "Unix Unleashed". But I have some few others which might help if you can take a look of free books.

http://www.maththinking.com/boat/booksIndex.html


Thanks
Zafar
Paddy_1
Valued Contributor

Re: Scripting book

While I agree "the New Korn Shell" is kind of a reference I started my shell programming with awk and I would recommend the following link with examples
http://www.novia.net/~phridge/programming/awk/
The sufficiency of my merit is to know that my merit is NOT sufficient