[CentOS] good shell script examples?

John Kennedy skebi69 at gmail.com
Mon Nov 15 14:22:10 EST 2010


On Mon, Nov 15, 2010 at 13:54, Max Hetrick <maxhetrick at verizon.net> wrote:

> On 11/15/2010 01:47 PM, Kill Script wrote:
> > I am looking for a beginner guide to shell scripting simple tasks on
> > CentOS (e.g. ssh'ing into a server / router / switch, checking for
> > certain things, then exiting and going to the next IP).
> >
> > Does anyone have any suggestions on where to look?  (I'm relatively new
> > to bash)
>
> The book Learning the bash Shell helped me out a lot.
>
> http://oreilly.com/catalog/9781565923478
>
> Regards,
> Max
>

To answer your question, I have liked UNIX Shells By Example by Ellie
Quigley (4th edition) it has good examples with explanations. The Linux
Command line and Shell Scripting Bible is a good teaching tool. A new
edition is due out next year but the current edition is still useful.

As to what you appear to want to do, if you require interactive logins (i.e.
ssh keys not set up for password-less logins) then bash is not the best
choice. For this you would want to use either Python (with pyexpect module)
or the Expect scripting language (Expect is an extension of the TCL
scripting language.

John

-- 
 John Kennedy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos/attachments/20101115/5f3251ce/attachment.html 


More information about the CentOS mailing list