Re: SSH login automation, get stuck at the last step.
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Tue, 13 Feb 2007 22:57:32 +0100
Schubert wrote:
But when I use Expect script above to automate the manual steps, itNothing expected, nothing shown.
will get stuck running the batch file. It simply shows the
[root@<Server Name>: <Server IP address>] prompt and then stops. Does
anybody know why this happens? Greatly appreciated.
[expect] the batch completion message
expect $batch_message
and then the prompt.
expect $prompt
then exit
exp_send "exit\r"
expect eof
with expecting some output it may be a good idea to expect
timeouts and errormesssages like:
exp_send $runbatchline\r
set ::JOB "not done"
expect \
$batchokmsg {
puts "batch run OK"
set ::JOB OK
# need prompt, continue will restart this expect
exp_continue
} $batcherrormsg {
puts "error in batch"
set ::JOB ERR
# you are still waiting for the prompt right?
exp_continue
} $prompt {
puts "back at the prompt JOB stat: $::JOB "
} timeout {
puts "sleeping at the job $::JOB ?"
}
something like the above, adapt to your case.
uwe
.
- Follow-Ups:
- Re: SSH login automation, get stuck at the last step.
- From: Schubert
- Re: SSH login automation, get stuck at the last step.
- References:
- SSH login automation, get stuck at the last step.
- From: Schubert
- SSH login automation, get stuck at the last step.
- Prev by Date: Re: More on byte compilation
- Next by Date: Looking for some tcl script code
- Previous by thread: SSH login automation, get stuck at the last step.
- Next by thread: Re: SSH login automation, get stuck at the last step.
- Index(es):
Relevant Pages
|