Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Expect: looping until there is no more input from spawn



On 11/03/2008, Edward Wright <edw@example.com> wrote:

>  Does Perforce return anything when it's done? If not, presumably there's
>  an eof?

I'm sure it does, but I like your idea #2 best. :)

>  Idea #1:
>  use "system" instead of "spawn" and test for the return value in the
>  condition
>
>  Idea #2:
>  Use a conditional expect and test for the return value (or eof) in the
>  loop, and if so, break out:
>
>  expect {
>     eof {
>         break
>     }
>     your stuff
>  }

This should almost certainly work. Now that you bring it up, I seem to
remember seeing it in examples. I'll add it and let you know next time
I have to do a mainline integration. :)

-- 
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links