9 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. UNIX for Beginners Questions & Answers
I have an expect script that appears to be working normally however for some reason, the remote side appears to be stripping off the variables from the awk command.
This is the original:
expect \"~]$\"
send \"sed 's/=/ /g;s/,/ /g' /home/file.txt | grep abc | awk '{print $6,$8}'This is the... (5 Replies)
Discussion started by: jimmyf
5 Replies
4. Shell Programming and Scripting
Hi.,
I need to ask question for expect script.
I have prompt like #
and very long script (orachk).
I added to expect script line
set prompt "(%|#|\\\$) $"
and insert into it also piece of code
----
expect {
timeout {
puts "Running..."
exp_continue
}
... (0 Replies)
Discussion started by: beckss
0 Replies
5. 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
6. Shell Programming and Scripting
I am using Expect to spawn a command that loops through a text file and runs the same command for each item in the text file.
The text file, named stat.txt looks something like this:
2007-04 alist 543
2008-07 blist 543
2008-03 xlist 345
2008-03 ylist 675
2003-03 zlist 567
The expect... (1 Reply)
Discussion started by: manouche
1 Replies
7. UNIX for Dummies Questions & Answers
I am trying to write a script that telnets out to multiple ip's, runs some commands exits and the telnets to the next ip. I wrote the following script and it works great until the program hits a nonresponsive ip.
I would like this to recognize the ip is bad and move on in the foreach loop. How... (4 Replies)
Discussion started by: pbaets01
4 Replies
8. Shell Programming and Scripting
hello all
pls can anybody point me a direction of capturing 2 arguments: one a line of text the other is a file.
In paticular how can i get the file
so for exampls, i create a script called monalisa
monalisa this is an angel from the 7th heaven booboo
where monalisa is the script... (6 Replies)
Discussion started by: sam4now
6 Replies
9. Shell Programming and Scripting
I am rather new to using expect and have only written a few scripts using it. I am trying to create a script that will read a file containing a number of hostnames and then for each one: ssh into the box, run a command, scp the output back to a center server.
So far I can make all that... (2 Replies)
Discussion started by: finnje
2 Replies