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)
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-15-2010, 05:54 PM
Max Hetrick
good shell script examples?
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-15-2010, 06:22 PM
John Kennedy
good shell script examples?
On Mon, Nov 15, 2010 at 13:54, Max Hetrick <maxhetrick@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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-15-2010, 06:24 PM
Scott Robbins
good shell script examples?
On Mon, Nov 15, 2010 at 04:47:02PM -0200, 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)
I have a page where I've posted what I've found to be useful links.
Spike: A slayer with family and friends. That sure as hell wasn't
in the brochure.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-15-2010, 07:38 PM
Sven Aluoor
good shell script examples?
On Mon, Nov 15, 2010 at 7:54 PM, Max Hetrick <maxhetrick@verizon.net> wrote:
> The book Learning the bash Shell helped me out a lot.
>
> http://oreilly.com/catalog/9781565923478
Classic online learning guide is "Advanced Bash-Scripting Guide"
http://tldp.org/LDP/abs/html/
(I use it as reference, downloaded a PDF version)
cheers Sven
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-15-2010, 08:47 PM
Spiro Harvey
good shell script examples?
> Does anyone have any suggestions on where to look? (I'm relatively
> new to bash)
http://www.google.com/search?q=bash+tutorial has quite a few.
I wrote a simple one a few years back:
> http://www.happyhacker.org/gtmhh/basha.shtml
This is great! Thanks for sharing.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-16-2010, 08:14 AM
Gabriel Tabares
good shell script examples?
On 15/11/2010 18:47, 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).
If you don't want to use ssh keys, you will have to write scripts that
interact with prompts, so you'll probably be looking at Expect, Python
(pexpect or paramiko) or Perl.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-16-2010, 09:32 AM
Kill Script
good shell script examples?
Gabriel Tabares wrote:
> If you don't want to use ssh keys, you will have to write scripts that
> interact with prompts, so you'll probably be looking at Expect, Python
> (pexpect or paramiko) or Perl.
In one case, this is what I have to do for some networking hardware. I
have to ssh in, run a command, and then analyze the output. I'm not
quite sure how to do this given Perl / Python / Expect / etc and am
hoping to find some good examples online that can help me get started.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
http://www.bsdmap.com/2010/11/06/ssh-shell-script/**------------------*Original*------------------From: *"Kill Script"<killscript@gmail.com>;Date: *Tue, Nov 16, 2010 02:47 AMTo: *"centos"<centos@centos.org>; Subject: *[CentOS] good shell script examples?*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)
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos