Re: Expect scripting

Knilges wrote:

I couldn't think of how to capture text from a telnet session so again
I reverted to what I am familiar with which is script and used exec
although I though spawn would do the same thing. What is the
difference there?
> My thoughts were that exec is using the shell and
spawn is basically doing the same. Is that misguided?

Shoot your guidedog! ;-)

NEITHER uses the shell.

exec has a shell-similar piping and redirection syntax.
but it ends there.

spawn hangs your process onto the tty side of a pty.
i.e. your spawned program will feel right at home just
like in the interactive environment it was written for.