The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-02-2008
Registered User
 

Join Date: Jun 2008
Posts: 10
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"
What might be different about spawn, than running script from the command line.
Reply With Quote
Forum Sponsor
  #2  
Old 09-02-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
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.
Reply With Quote
  #3  
Old 09-03-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 250
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}
..and instead of sending whitespace, send a newline.

HTH
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:57 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 Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0