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)
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
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
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.
Classic online learning guide is "Advanced Bash-Scripting Guide"
(I use it as reference, downloaded a PDF version)
cheers Sven
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.
http://home.roadrunner.com/~computertaijutsu/shellscripting.html
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
I wrote a simple one a few years back:
This is great! Thanks for sharing.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Kill Script Sent: Monday, November 15, 2010 9:06 PM To: CentOS mailing list Subject: Re: [CentOS] good shell script examples?
I wrote a simple one a few years back:
Is there an alternate location for this? My corp's "websense" blocks this site for some reason.
This is great! Thanks for sharing. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.Hubbell.com - Hubbell Incorporated**
On Wed, Nov 17, 2010 at 15:08, Brunner, Brian T. BBrunner@gai-tronics.comwrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Kill Script Sent: Monday, November 15, 2010 9:06 PM To: CentOS mailing list Subject: Re: [CentOS] good shell script examples?
I wrote a simple one a few years back:
Is there an alternate location for this? My corp's "websense" blocks this site for some reason.
They probably only want sad hackers... John
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.
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.