Hi.,
I need to ask question for expect script.
I have prompt like [root@tlvexadb01 orachk]#
and very long script (orachk).
I added to expect script line
set prompt "(%|#|\\\$) $"
and insert into it also piece of code
----
----
But with no success. When I received desired prompt (as above) script is remain with Running phrase and only after cntr+c combination finishing.
Probably I miss something.
Could anyone help me.,
Thanks and regards, beckss.
Last edited by vbe; 03-23-2016 at 12:02 PM..
Reason: code tags
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)
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)
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)
Hi Folks.
I need change something into file and after all manipulation I need delete only last COMMA into this piece of code ->
GROUP 1 (
'/oralog1/ORAPRD/log01a.dbf',
'/oralog2/ORAPRD/log01b.dbf'
) SIZE 512M,
GROUP 2 (
'/oralog1/ORAPRD/log02a.dbf',
... (12 Replies)
Hi experts,
I have two question about expect script
questions 1
send "tar -xjvf a.tar\r"
send "ifconfig\r"
I want to know if it just run "ifconfig after "tar -xjvf a.tar complete. or the two cmd run at the same time
question 2
after I use the expect to ssh to the... (1 Reply)
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)
I have created a dummy file -demo.txt
On my machine-A (oslevel-5300-08) I can display the file content in HEX format through VI editor using :%!xxd but on other machine-B (oslevel - 5300-06) , I get error as "sh: xxd: not found."
machine-A:
$ cat demo.txt
Hello World !
I can display... (7 Replies)
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)
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)