Operating System - HP-UX
1833753 Members
2494 Online
110063 Solutions
New Discussion

I'm really poor at scripts- help?

 
SOLVED
Go to solution
SM_3
Super Advisor

I'm really poor at scripts- help?

Hello

I am really poor at scripting.

Where is a good starting point upto intermediate level?

Thanks



13 REPLIES 13
Mel Burslan
Honored Contributor

Re: I'm really poor at scripts- help?

trial and error and creating useful projects for yourself is the best way to learn scripting.

find tasks that you tediously do everyday and try scripting them for your own use.

I have found the O'Reilly book "Unix in a Nutshell" by Daniel Gilly (ISBN 1-56592-001-5) extremely helpful when the man page confuses the hell out of me about a command.

HTH
________________________________
UNIX because I majored in cryptology...
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: I'm really poor at scripts- help?

I think since you are essentially starting from scratch that I would immediately suggest a Plan P. Rather than trying to learn shell scripting (you will absolutely, positively need some), if I were starting over, I would learn Perl. If you do there is very little reason to learn awk, grep, cut, paste, ... --- all the stuff that makes it possible to do useful things in the shell.
Don't misunderstand, it's very important that you are at least somewhat proficient in the shell but that's going to occur as a by-product of learning Perl. You will also learn regular expressions so there is really no downside to this and as an added benefit, if you learn Perl, you also have an extremely powerful scripting language for Windows as well.

In any event, O'reilly has some nice books on Perl and the Shell.
If it ain't broke, I can fix that.
John Kittel
Trusted Contributor

Re: I'm really poor at scripts- help?

From the HP technical documentation web site, http://docs.hp.com/

you can find the HP shells user's guide, with a chapter or two on scripting, http://docs.hp.com/hpux/pdf/B2355-90046.pdf
Steven E. Protter
Exalted Contributor

Re: I'm really poor at scripts- help?

HP education has a good course on shell scripting. I've seen the material, but never took the course.

http://education.hp.com

If you have the budget, its a good idea.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Lee Hundley
Valued Contributor

Re: I'm really poor at scripts- help?

Having only been into *nix for about 4 years now, I'll pass on the a great piece of advice I was once given. "Buy an old UNIX book". Sounds a bit bassackwards, but the older books contain more nifty features and forgotten shell tricks than most any new book on the shelves these days. My personal favorite is "A Practical Guide to UNIX System V 2nd. Ed" published 1991. If you have a PC Recycler in the area, they get these things in all the time. I once even scored an entire box full of circa 1992 official HP books for $1.
It is my firm belief that it is a mistake to hold any firm beliefs
Marvin Strong
Honored Contributor

Re: I'm really poor at scripts- help?

I second Mr. Stephenson. Learn Perl, granted there are things that perl is overkill for. But I find myself mostly programming perl whenever I need a script for something.

Plus they are things that you just can't accomplish easily with a shell language. So you will be looking for another solution.

D Block 2
Respected Contributor

Re: I'm really poor at scripts- help?

I've been thinking about your concern...

If you want to learn scripting from the shell language, then search itrc.hp.com for sample-scripts. try them and make changes.

once you make a change you own the code, yes, learn from the best, and apply your own changes (sort of your own personal touch, if you like.)

you learn from other script programmers, then you become a better one yourself...

hope this gives you some focus in becoming a better script writer..

best of luck
Golf is a Good Walk Spoiled, Mark Twain.
isaac_loven
Frequent Advisor

Re: I'm really poor at scripts- help?

I found the best book for scripting and all unix admin is "Unix Power Tools".
http://www.amazon.com/gp/reader/1565922603/ref=sib_dp_pt/102-0162940-2094521#reader-link
Francisco J. Soler
Honored Contributor

Re: I'm really poor at scripts- help?

Hi SM,

the classical book "The Unix programming environment" (Kernighan and Pike) is a must read reference, there are 3 chapters very interesting about shell programing and filters.

Frank.
Linux?. Yes, of course.
Nicolas Dumeige
Esteemed Contributor

Re: I'm really poor at scripts- help?

Hello,

Whatever book you pick, look for one that comes with numerous and explaned exemples. Shell scripting is pretty readble right away, but script languages that uses regular expression or implicit behaviour can be tricky ! Practice is the best teacher of all ;)

Cheers

Nicolas
All different, all Unix
Thomas Bianco
Honored Contributor

Re: I'm really poor at scripts- help?

TLDP.ORG has a free guide called the Advanced Bash Scripting Guide. Granted, it's primarily for linux, but it can be really helpful in tight spots.
There have been Innumerable people who have helped me. Of course, I've managed to piss most of them off.
sam_111
Trusted Contributor

Re: I'm really poor at scripts- help?

hi SM,

What you have to do is start using scripts which are already there. start with shell scripts they are very easy to use and learn also. Then after some time you can start writing simple scripts.

When you keep on writing scripts only you can become an expert. Belive me its not tough to become an expert if you start writing now.

Check this link these are sys admin scritps posted in ITRC. Some of them are complicated and tough just look at them

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51050

I am doing the same thing .

regards,

sam
"Hard Work always Pays off"
SM_3
Super Advisor

Re: I'm really poor at scripts- help?

hello

thanks for the replies

I will look into Perl for sure!

Thanks.