[Linux-users] any 'expect' gurus?
Bruce Marshall
bmarsh
Thu Aug 16 11:11:58 PDT 2007
On Thursday 16 August 2007, Lonni J Friedman wrote:
> > Since you start a new shell... ? maybe the shell doesn't terminate?
>
> That's the problem, the new shell never terminates from the expect script.
Can't send expect and Exit to exit the shell? Or perhaps once you have
expect start a new shell... expect loses control?
There's some discussion under 'disconnect' about forked processes.....
send_user "password?\ "
expect_user -re "(.*)\n"
for {} 1 {} {
if {[fork]!=0} {sleep 3600;continue}
disconnect
spawn priv_prog
expect Password:
send "$expect_out(1,string)\r"
. . .
exit
}
That's just part of the example but it looks like it starts a program in
disconnect and then exits out.
I'm googling for more.
More information about the Linux-users
mailing list