This is the mail archive of the
mailing list for the Cygwin project.
Need help running expect script under CYGWIN...
- From: cledford <ledfordc at fauquierhospital dot org>
- To: cygwin at cygwin dot com
- Date: Fri, 30 Jun 2006 10:41:25 -0700 (PDT)
- Subject: Need help running expect script under CYGWIN...
Hi, much thanks in advance for any and all help anyone can provide.
I'm by no means a scripting/*NIX/Expect guru - but a while back was able to
stumble through setting up Windows/CYGWIN/expect enough to put together a
really functional system for basic network management of Cisco routers and
switches. Everything ran fine on my old laptop which died recently. I've
just downloaded the latest CYGWIN to my new laptop (I'm assuming a newer
version since last July) and none of my scripts will work any longer. They
are very basic - essentially they just spawn telnet to a host and do what's
in the script. It appears that with the current version of CYGWIN (or the
expect that runs in it) the spawn sessions are dying early. I've scoured
the internet for help, but while there are several people in my same boat -
I'm not finding any solutions. Attached below is my error message, my
expect script, and my (simple) shell script that pipes in a list of
names/IPs as arguments to expect.
I really relied on this to manage a large number of switches in the past and
am really hurting not having this - thanks for any input at all.
Spawn telnet pn-abrams-switch
Send: invalid spawn id (4)
set timeout 20
set USER_NAME "XXXXX"
set USER_PASS "XXXXXX"
set ENABLE_PASS "XXXXXX"
set ROUTER $argv
spawn telnet $ROUTER
expect "Username: "
expect "Password: "
send "term length 0\r"
send "sh run | include hostname\r"
send "sh run"
for ROUTER in `cat names.txt`; do ./expect-BABW-show_run.txt $ROUTER; done
View this message in context: http://www.nabble.com/Need-help-running-expect-script-under-CYGWIN...-tf1874435.html#a5124210
Sent from the Cygwin Users forum at Nabble.com.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html