10 More Discussions You Might Find Interesting
1. Programming
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
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)
Discussion started by: brettski
1 Replies
3. Programming
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
4. Shell Programming and Scripting
Do expect script have "or" statement?
sound like this:
expect {
"A" or "B" {
send "123"
}
"C" {
send "567"
}
I know expect can separate that to do this
expect {
"A" { send "123" }
"B" { send "123" }
"C" { send "567" }
} (8 Replies)
Discussion started by: sk860811
8 Replies
5. Shell Programming and Scripting
Hi,
I am new to expect script and I am having difficulty in adding an if statement into a expect FTP login script. Here is the code:
#!/usr/local/bin/expect -f
set FTP_SITE
set FTP_USER
set FTP_PASS
set FTP_FILE
spawn ftp
match_max 100000
expect -exact "ftp> "
send -- "open... (1 Reply)
Discussion started by: jrcai
1 Replies
6. Linux
Ok, so I have this script that was provided to me by one of the posters on this site.
This script seems to be perfect. However, since this is a telnet script, i need to add an if then statement to it but dont know how to do it.
What i want to do is to have this script spit out a certain... (3 Replies)
Discussion started by: SkySmart
3 Replies
7. Shell Programming and Scripting
Hi,
I have a script which is logging in to network devices via ssh using expect programming.
My problem is that if I do
Code:
ssh host -l uname
It only works if y ssh_config is setup to use Protocol 1,2 and my network device I am trying to connect has ssh 1 but not 2. If the... (0 Replies)
Discussion started by: kminev
0 Replies
8. Shell Programming and Scripting
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
9. Shell Programming and 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
10. Shell Programming and Scripting
I am using expect
I dont know tcl but trying to use a control statement to send requests from an input file - dont know what I am doing to be honest as I dont know tcl and dont use expect too much...
Any help?
See below
Basically I am opening a telnet session to a server which works fine... (2 Replies)
Discussion started by: frustrated1
2 Replies