Expect slowing down / missing characters


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Expect slowing down / missing characters
# 1  
Old 05-16-2013
Expect slowing down / missing characters

Im writing an expect program to connect to cisco routers and run commands.
my commands file has only two entries
Code:
show version
show running-config

when I run the script, the first command is run without a problem.
The second command isn't.
The "s" is missing at the device command line, the "h" is the only character at the command line. The script pauses for a few seconds, then moves on to the exit line in the script.

this is what it looks like


Code:
cisco WS-C3750-48P (PowerPC405) processor (revision J0) with 118784K/12280K bytes of memory.
Processor board ID CAT0936Z4SZ
Last reset from power-on
Target IOS Version 12.2(25)SEE
4 Virtual Ethernet interfaces
48 FastEthernet interfaces
4 Gigabit Ethernet interfaces

Router#how running
              ^
% Invalid input detected at '^' marker.

and heres my code


Code:
set cmdlist [open "listofcmds" "r" ]
while { [gets $cmdlist command] >=0 } {
send "$command\n"
sleep 10
expect "#"
                }

send "exit\n"

thks in advance for help

Last edited by Scott; 05-16-2013 at 10:02 AM.. Reason: More code tags
# 2  
Old 05-28-2013
No ideas ??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

awk slowing down -- why?

I have an awk script that extracts data from log files and generates a report. The script is incrementing elements in arrays, summing fields depending on contents of other fields, and then in END performing some operations on those arrays. It seemed to be taking longer than it should on my... (6 Replies)
Discussion started by: treesloth
6 Replies

2. Shell Programming and Scripting

Expect Special Characters

Hi, I am familiar with using a backslash to escape a $ in a send command, but this device I am using expect to talk to has a regex expression that I need to input and it is a bear. Is there a list of all the characters that require escaping in an expect send statement ? Here is what I need to... (0 Replies)
Discussion started by: ob2s
0 Replies

3. Red Hat

Yum - resolving missing dependencies that are not missing

I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following: sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm Loaded plugins: fastestmirror Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies

4. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

5. Shell Programming and Scripting

How to escape Special Characters in Expect programming?

Hi, I have written a unix expect utility "ssh-login.exp" which connects (ssh) to remote host and execute some shell script. I am calling this "ssh-login.exp" utility from another shell script. "ssh-login.exp" takes username, password, host and shell script path to execute on remote host. All... (1 Reply)
Discussion started by: Mahesh Desai
1 Replies

6. Shell Programming and Scripting

expect script with special characters?

Hello all, I'm writing an expect script that will connect to an IMAP server and issue IMAP commands. The problem is that some of the text I need to send includes "quotes" and also !@#$%^&* special characters. For example, my password is VFR$5tgb but I cannot "send" this because Expect doesn't... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

7. UNIX for Dummies Questions & Answers

Sendmail process "Toomany" system slowing down

Hello Experts I have M4000 Solaris 10 server, from few many days there are too many sendmail and mail.local process starting on server and each time i need to kill mannualy using pkill send mail, some time there will 600 of them taking 30mb memory for each and hence slowing down the server,... (2 Replies)
Discussion started by: karghum
2 Replies

8. Shell Programming and Scripting

expect 'missing close-brace' error

my expect script fails when it tries to send a password that I have that uses {}'s. Hoping I can correct that. It doesn't complain about the %, #, *, /, ? or ~ characters only the {}'s. #!/usr/bin/expect spawn ssh root@ca199 expect dsa {send... (1 Reply)
Discussion started by: phpfreak
1 Replies

9. UNIX for Advanced & Expert Users

mysqldump slowing down the process?

Hi All, I have a data calculation process-a perl script running each and every hour which will do some calculations on the data stored in a mysql server. Normally it tooks around 2minutes (max) to complete. But in case if i did any actions on the linux box where the database is... (7 Replies)
Discussion started by: DILEEP410
7 Replies

10. UNIX for Dummies Questions & Answers

missing hidden characters

I made a small change to a UNIX script. When I tried to run it I received the following message: /bin/ksh: ^M: not found /bin/ksh: ^M: not found /bin/ksh: ^M: not found As ^M is a non printing character, I don't know how to discover where it is missing. How can I correct thiis... (2 Replies)
Discussion started by: SUSANR9999
2 Replies
Login or Register to Ask a Question