[Linux-users] any 'expect' gurus?

Lonni J Friedman netllama
Thu Aug 16 11:19:56 PDT 2007


On 8/16/07, Bruce Marshall <bmarsh at bmarsh.com> wrote:
> 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

how do you mean exactly?

> 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.


Thanks for the effort, but don't kill yourself.  I ended up finding an
alternative solution that removes the need for expect altogether.


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama at gmail.com
LlamaLand                       http://netllama.linux-sxs.org



More information about the Linux-users mailing list