Sponsored Content
Full Discussion: Expect for Windows
Top Forums Shell Programming and Scripting Expect for Windows Post 302165733 by dave_m on Friday 8th of February 2008 03:42:33 PM
Old 02-08-2008
still having problems with setting variables

I've been stuck on this one for awhile.. I am ussing ActiveState tcl 8.4.16.0, 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.

Dave
Smilie
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Windows expect

I am using ActiveState 8.4.16.0, 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

2. 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

3. 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

4. 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

5. 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

6. 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
ZGREP(1)                                                      General Commands Manual                                                     ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy