Hello All,
I am writing an Expect Script to execute some commands over ssh then exit the script.
The script works just fine if I automate everything and assuming the correct password was entered.
So this Expect Script gets executed from a Bash script...
Hi All,
I need help in making my script run perfectly as expected.
This is a snippet from my script. I am trying to read the ";" from the below output using the expect command, but the command is not detecting it.
please advice what's wrong with my exepct syntax ( I run expect in ksh script on Solaris 10 machine )
I want to verify if OS is linux
so if it true the expect check if prompt is "#" or ">"
and then run the "ls" command
but I get the error below
please advice what could be the problem
OS=solaris
expect_do_something=`cat << EOF
set timeout -1
spawn telnet 0 $IP_AD
Hi -
I'm sure there is a simple answer to this question - I have a very basic expect script:
Code:
#!/usr/bin/expect -f
spawn pwd
expect -exact "~]#" # My Prompt
spawn ls
expect -exact "~]#"
spawn rm -f *.ver
expect -exact "~]#"
At the command prompt in the same directory I run:
touch blah.ver (to create a test file)
check with an ls, and cl
I have a bash script, exec.sh like
some command
expect test.exp
continue other command
in the test.exp file, I have a snippet like:
while {[gets $cmds command]>=0} {
send "$command\r"
expect {
"*OK*" {puts $vout $command}
"*fail*" {puts $iout $command}
"*blocked*" { what should I put here????}
}
}
so I want to put something in the curly bracket so that the executio
I have the following expect script that uses rsync and expect to automate the process.
#!/usr/bin/expect
rsync -a --progress --delete --rsh='/usr/bin/ssh' root@00.00.00.00:/var/www/test/ /var/www/test
expect "password:"
send "XXXXX";
interact
However the rsync command of course does not work inside the expect script. Any ideas for a workaround?
I am building a simple ssh login wrapper tool to help auto login to one of hell
lots of servers.
It first takes descriptions from user input and then extract the corresponding (most relavant) server ip and password stored safely somewhere, using which it synthesis a piece of expect script.
Hi, I'm writing a shell script that calls a few commands that prompt the user for two simple yes/no questions. if the answers are consistent (the first is a yes, the second is a no), what would my expect script look like? Google is only giving me answers for scripts where I telnet or ssh.
All,
EDIT
I want to execute a unix statement in Expect script and get an output without having to include the interact statement.The unix statement outputs rsize value for a process.