10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I'm using expect to log into a remote host and then execute another script. A log of the script is being created but I can't see to get the script to display while it's running. Any ideas would be appreciated. Here is the script.
#!/bin/bash
cd /root
cat /root/hostname1.txt | while read... (1 Reply)
Discussion started by: jimmyf
1 Replies
2. UNIX for Beginners Questions & Answers
Have an expect script but can't seem to de-bug it. It's stalling at the password prompt. If anyone can see a mistake, kindly let me know. Thanks.
Here is the error:
spawn ssh -o StrictHostKeyChecking=no user@xx.xx.xx.xx rpm -qa
# Warning! You have entered into a secured area! #
# All... (2 Replies)
Discussion started by: jimmyf
2 Replies
3. 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
4. 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
5. 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
6. 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
7. Shell Programming and Scripting
Hi all,
I have got a small expect script like this one.
#!/usr/bin/expect -f
set timeout 2
spawn ftp $env(IP)
match_max 100000
expect -exact "Name"
send -- "$env(USER)\n"
expect -exact "Password:"
send -- "$env(PASSWORD)\n"
expect "%"
send "bin\r"
expect "%"
send "prompt\r"... (5 Replies)
Discussion started by: stinkefisch
5 Replies
8. Shell Programming and Scripting
Hi all,
I have written a small expect script which should spawn a telnet session login and execute some commands.
#!/usr/bin/expect -f
spawn telnet $env(IP)
match_max 100000
expect "login:"
send -- "******\n"
expect -exact "Password:"
send -- "****\n"
expect "%"
Now I have got... (2 Replies)
Discussion started by: stinkefisch
2 Replies
9. Shell Programming and Scripting
I wrote some expect script to telnet to some device to execute some commands.Firstly,I can't get full result some time,then I try to add some "sleep" command in it.Fortunately it works.
My idea about it is that it uses sleep command to wait the result to be displayed.Am I right or correct the... (4 Replies)
Discussion started by: robbiezr
4 Replies
10. 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