The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Calling expect scripts from other expect scripts seva Shell Programming and Scripting 0 04-03-2008 02:45 PM
tcl/expect calsum Shell Programming and Scripting 7 03-26-2008 01:23 AM
Tcl expect HELP dave_m Shell Programming and Scripting 0 02-27-2008 11:08 AM
Expect and auto expect command arun_v Shell Programming and Scripting 0 03-29-2006 08:31 AM
Expect with tcl/tk sanjustudy Shell Programming and Scripting 0 10-10-2005 06:48 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-25-2007
earnstaf earnstaf is offline
Registered User
  
 

Join Date: May 2007
Posts: 113
Expect/Tcl help?

Does anyone know of an expect/tcl forum that is as helpful as this one is for shell scripting?

Or if anyone has any expect knowledge, can you please provide some guidance on how to write to a local error log based on output from a ssh session?
I have something like this:
Code:
foreach host $hostlist {
spawn ssh -oPort=22 -oStrictHostKeyChecking=no -oCheckHostIP=no $USER@$host-sdp
expect {
  "Connection closed by remote host" { puts "$host is down.  Please try again later."; continue }
  "password:" { send "$PASSPH\r" }
If they first condition is matched and it sends the message about the host being down, I'd like to output the error to an errorlog.

How do I a.) initialize the log file and b.) write to it in the case of an error?

Thanks for any help. Again, I realize this isn't the forum for expect/tcl, but it has been very helpful to me in the past in learning shell scripting, so hopefully someone can provide some insight or at least point me in the right direction.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0