I don't understand why this script attempts to escape the variable notation ($)
preceding the argv list.
it is utterly broken this way.
example:
Short answer: There is no need to escape the dollar sign notation and it breaks interpretation of characters during command expansion.
Hi,
I am facing a strange problem while executing a script from a solaris server. This script calls another one to execute "expect" commands on some other 40 servers (all AIX 5200). I am passing username and password to the "expect" script as arguments. My problem is that it is showing the... (4 Replies)
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)
Hi all,
I have wriiten an expect script that genearates a public private key pair through ssh-keygen and then copies that key to the authorized keys file of the remote system . The problem i am facing is when i get a password for the remote machine containg a trailing backslash , the send command... (4 Replies)
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)
hi all, guys i have a problem in this code...
any help ?
#!/usr/bin/expect
if { $argc != 3 } {
puts "Usage:"
puts "$argv0 username oldpwd newpwd"
exit
}
#set machine
set username
set oldpwd
set newpwd
set completed_list " " (2 Replies)
Hi,
Have strange problem.
When I run an expect script towards a switch, it will not work.
$ ./test2
spawn ssh admin@sesafdd101
Password:
Last login: Thu Dec 25 13:20:54 2008 from 172.20.96.14
ECN430/330/212 Linux, based on Wind River Linux glibc_small (standard) 2.0
Trying... (1 Reply)
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)
I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues:
set REMOTE "/root/scripts/remote"
...
log_user 1
send_user "Executing remote script as $user...\n"
send_user "Command to execute is: $REMOTE... (1 Reply)
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
LEARN ABOUT MOJAVE
tcllib_interp
interp(n) Interpreter utilities interp(n)
__________________________________________________________________________________________________________________________________________________NAME
interp - Interp creation and aliasing
SYNOPSIS
package require Tcl 8.3
package require interp ?0.1.1?
::interp::createEmpty ?path?
::interp::snitLink path methodlist
::interp::snitDictLink path methoddict
_________________________________________________________________DESCRIPTION
This package provides a number of commands for the convenient creation of Tcl interpreters for highly restricted execution.
API
::interp::createEmpty ?path?
This commands creates an empty Tcl interpreter and returns it name. Empty means that the new interpreter has neither namespaces, nor
any commands. It is useful only for the creation of aliases.
If a path is specified then it is taken as the name of the new interpreter.
::interp::snitLink path methodlist
This command assumes that it was called from within a method of a snit object, and that the command mymethod is available.
It extends the interpreter specified by path with aliases for all methods found in the methodlist, with the alias directing execu-
tion to the same-named method of the snit object invoking this command. Each element of methodlist is actually interpreted as a
command prefix, with the first word of each prefix the name of the method to link to.
The result of the command is the empty string.
::interp::snitDictLink path methoddict
This command behaves like ::interp::snitLink, except that it takes a dictionary mapping from commands to methods as its input, and
not a list of methods. Like for ::interp::snitLink the method references are actually command prefixes. This command allows the
creation of more complex command-method mappings than ::interp::snitLink.
The result of the command is the empty string.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category interp
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
KEYWORDS
alias, empty interpreter, interpreter, method, snit
CATEGORY
Programming tools
COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
interp 0.1.1 interp(n)