Re: capturing output from a program that prompts for input

2008-09-10 Thread Jake
I finally understand what’s happening, thanks for the link to http://perl.plover.com/FAQs/Buffering.html. Perl’s system command starts a program’s whose stdout becomes my terminal (and that’s why it works), other ways of forking commands (backticks, open, open2) set stdout to a file that is not a t

Re: capturing output from a program that prompts for input

2008-09-10 Thread Mr. Shawn H. Corey
On Tue, 2008-09-09 at 20:08 -0700, Jake wrote: > test.pl cant be modified, im looking for something that will work with > any program, my own or not. > If test.pl reads and writes thru STDIN and STDOUT, you may be able to use a bi-directional pipe. See: perldoc IPC::Open2 perldoc IPC::Open3 perl

Re: capturing output from a program that prompts for input

2008-09-10 Thread Jake
test.pl cant be modified, im looking for something that will work with any program, my own or not. On Sep 9, 10:11 pm, [EMAIL PROTECTED] (Raymond Wan) wrote: > Hi, > > Seems like what you need is to do an "autoflush".  Try searching for it > with Google...this might be a good start and enough for

Re: capturing output from a program that prompts for input

2008-09-09 Thread Mr. Shawn H. Corey
On Tue, 2008-09-09 at 14:04 -0700, doubleHelix wrote: > I am having a problem in capturing the output and exit value from a > system command that prompts the user for input. The following shows a > simplification of the problem. Im trying to get it so that all the > text before the prompt gets outp

Re: capturing output from a program that prompts for input

2008-09-09 Thread Raymond Wan
Hi, Seems like what you need is to do an "autoflush". Try searching for it with Google...this might be a good start and enough for what you want: http://bytes.com/forum/thread603712.html Note that stdout tends to be buffered and stderr not (since it's for error messages and they should app