From: Ed R. <er...@pa...> - 2002-03-02 05:40:27
|
Here's what I'd like to do with Expect.pm: * Spawn a telnet to somewhere. * Invoke a subshell * From within that subshell, call another Perl program one or more times to interact with the telnet process spawned by the parent process. My first try was to write a short Perl program that spawned a telnet, did an expect to get to the prompt, then did 'system("bash");' to get into the subshell. I then invoked program#2 which tried to interact with the telnet. I used the pty that the spawned telnet was using as fd's 0,1 and 2 (found via lsof) as the filename to re-open with exp_init(), but that didn't work. It did sent the data to the pty, but it was received by the parent program rather than the spawned telnet. I suspect I'probably running afoul of the pty master/slave business, which I'm not very familiar with. Any idea how to get what I want to happen? Is it even possible? Thanks, -- Ed |