The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

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 10:45 AM
tcl/expect calsum Shell Programming and Scripting 7 03-25-2008 09:23 PM
Expect/Tcl help? earnstaf UNIX for Dummies Questions & Answers 2 07-26-2007 07:01 AM
Expect and auto expect command arun_v Shell Programming and Scripting 0 03-29-2006 04:31 AM
Expect with tcl/tk sanjustudy Shell Programming and Scripting 0 10-10-2005 02:48 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2008
Registered User
 

Join Date: Jan 2008
Location: Magnolia Texas
Posts: 8
Tcl expect HELP

In the following "for" loop I assume the the script will expect "anyway", "first" NOT in any paticular order and send "yes" when there found, breaking out of the loop when "$prompt" is found. The way it is working is like 3 individual expect lines, and they MUST be in cronological order. ANY help will be greatly appreciated..

Dave



for {} 1 {} {
expect -i $id timeout {FAIL} *anyway*
send "yes\r\n"
send_user "\n$expect_out(buffer),$expect_out(1,string)\n"
sleep 1
expect -i $id timeout {FAIL} *first*
send "yes\r\n"
send_user "\n$expect_out(buffer),$expect_out(1,string)\n"
sleep 1
expect -i $id timeout {FAIL} -re $prompt
{break}
send_user "\n$expect_out(buffer),$expect_out(1,string)\n"
}
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0