Looking to get lucky again with another expect question.

Brian St. Pierre brian at bstpierre.org
Mon Jul 25 16:54:31 EDT 2011


On Mon, Jul 25, 2011 at 1:48 PM, Steven W. Orr <steveo at syslang.net> wrote:
> The general solution would be to run an
> expect script that would simply act as a passthrough to guarantee that
> whatever I run would think it had a tty, and would therefore be line buffered
> by default instead of fully buffered. I know it would look something like this:
>
> #! /usr/bin/expect --
> spawn something
> interact
>
> It's that middle line I don't know how to craft.

I think you want:

    eval spawn $argv

as the middle line. This should work most of the time -- you'll have
to be careful of quoting since this will "eat" a layer of quotes.

I think an even more general-purpose method would be to use the -t
flag of ssh (if you're calling it directly) or something like
paramiko.Channel.get_pty().

-Brian


More information about the gnhlug-discuss mailing list