Expect for Windows

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Expect for Windows
# 8  
Old 02-08-2008
Sorry..I haven't checked back on this thread. If you have more details and this is still a problem I'll try to help.
# 9  
Old 02-08-2008
still having problems with setting variables

I've been stuck on this one for awhile.. I am ussing ActiveState tcl, I am executing an expect script from windows that telnets to
an HPUX box, this part works well, then I try to grep Info from a file
and set a variable with the info. Simple in UX, not so simple from a PC..
I can tell from the history file on the HPUX box that the grep
portion is working, but it is not setting the variable, here is the line of code.

set X [send "grep test /tmp/testfile\r\n"]

I'm expecting X to be set with the grep'd value of test from the /tmp/testfile. I'm seeing the grep function work, but the variable is not getting set? Is the variable not being exported to the HPUX machine?
Any help will be gretly appreciated.

Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Programming

Expect script returning string following a found expect.

I'm fairly new to scripting so this might not be possible. I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version: #show version ... (0 Replies)
Discussion started by: IBGaryA
0 Replies

2. Programming

Calling expect script inside another expect

Hi, Am very new to expect scripting.. Can You please suggest me how to call an expect script inside another expect script.. I tried with spawn /usr/bin/ksh send "expect main.exp\r" expect $root_prompt and spawn /usr/bin/ksh send "main.exp\r" expect $root_prompt Both... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

3. Shell Programming and Scripting

Expect - Comparison of expect value and loop selection

Hello All, I am trying to automate an installation process using expect and sh script. My problem is that during the installation process the expected value can change according to the situation. For Example if this is a first time installation then at step 3 I'll get "Do you want to accept... (0 Replies)
Discussion started by: alokrm
0 Replies

4. Shell Programming and Scripting

Need help with Expect script for Cisco IPS Sensors, Expect sleep and quoting

This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies

5. Shell Programming and Scripting

strange expect script behavior, or am i misunderstanding expect scripting?

Hello to all...this is my first post (so please go easy). :) I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Discussion started by: v1k0d3n
2 Replies

6. Shell Programming and Scripting

Windows expect

I am using ActiveState, I have found this code format that seems to work great: expect "Login:*" send "root\r" expect ">*" send "ksh\r" expect "#*" send "tar -xvf /dev/rmt/0m\r" expect "#" My question is, how do I set it up to fail out if one of the expect calls doesn't... (0 Replies)
Discussion started by: dave_m
0 Replies
Login or Register to Ask a Question