in reply to Expect with command that spawns more processes

I have no idea why the subprocess would not send its data to the same terminal that its parent is talking to. Is it at all possible that the subprocess is talking on STDERR when you Expect-ed STDOUT? You could try to redirect STDERR to STDOUT and see if it makes a difference.

If that fails, you could try something random like spawning bash -l and then tell bash to run the Perl command. Maybe the subprocess will get confused enough to keep on talking to bash which is talking to Expect. Probably not. (If by some miracle that works and you don't want to hard-code the shell like that, you can perl -e 'exec {"$shell"} -sh' to get any login shell.)

After that (maybe before trying random ideas) I would suggest reporting it as a possible bug and see if the current maintainer can suggest anything useful.

Replies are listed 'Best First'.
Re: Re: Expect with command that spawns more processes
by perrin (Chancellor) on Mar 01, 2004 at 18:39 UTC
    I have no idea why the subprocess would not send its data to the same terminal that its parent is talking to.

    Thanks, your comments here caused me to go back and take a closer look at the generated Makefile, and it turned out that the problem came from the fact that it was the "make" command that generated this prompt, not the "perl Makefile.PL" command. I didn't realize this because I have it all scripted to run them automatically.

    So, the answer is that commands launched with Expect which spawn subprocesses are not a problem at all.