![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using expect script in a shell script or vice versa | nua7 | Shell Programming and Scripting | 0 | 07-18-2008 04:16 AM |
| Help with expect script | somedude | Shell Programming and Scripting | 3 | 05-01-2008 11:47 AM |
| IP# Strangeness Please Help | jolene | IP Networking | 4 | 10-24-2006 07:16 AM |
| help with 'expect' script? | maeve | Shell Programming and Scripting | 0 | 06-02-2004 03:18 PM |
| Expect Script HELP | zuinc | Shell Programming and Scripting | 2 | 04-30-2002 06:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Expect Script Strangeness
Hi all,
I am trying to use a very simple expect script to automate entering one or two details into a console connection of a solaris machine so that I can do a boot net - install. If I run the console connection script manually myself, it connects fine and when I hit enter, I am on the machine and can log in etc. Problem is, when I spawn this exact same command from within expect, the connection seems to work but when I hit enter, nothing Code:
spawn /console/conn.sh machinename sleep 15 expect "Connected to" send "" expect "telnet>" send "send break\r\r" expect "ok" |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You don't need double \r\r statement, one carriage return is OK, also, set the timeout to indefinite with : set timeout -1
Your machine may be experiencing slow responses, so rule that out. You can also try autoexpect too that comes with the expect installation. |
|
#3
|
|||
|
|||
|
Sysgate is right on. A couple things I'd do would be too add a debug option to the script...
Code:
if {[lsearch -exact $argv "-debug"] >= 0} {exp_internal 1 ; log_user 1}
HTH |
|||
| Google The UNIX and Linux Forums |