in reply to Solved: Testing an interactive script with EOF on input

mamawe:

Looking at the Expect documentation, I'd try a few different things:

Note: I've never used Expect, so so take these with a grain of salt. However, while reading the FAQ section, the question "How come when I automate the passwd program to change passwords for me passwd dies before changing the password sometimes/every time?", it leads me to think that soft_close should do the trick.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Testing an interactive script with EOF on input
by mamawe (Sexton) on Oct 14, 2011 at 09:35 UTC

    Thanks for your reply.

    I did try soft_close and hard_close, but these function close the whole pty so that I can't get the output of my program afterwards.

    The slave function returns the pty as seen by the tested script. But from there I don't see a way to close STDIN for this script.