Home > Archive > PERL Beginners > August 2005 > System, open, SHELL redirect
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
System, open, SHELL redirect
|
|
| Steve Tran 2005-08-26, 6:56 pm |
| Hello,
I guess I wasnt clear enough in my earlier mail.
what I meant was lets say I have 2 programs,
exe1 and exe2
exe2 is input to exe1
so I want to call this from my perl wrapper as
system ("exe1 exe2"); or `exe1 exe2`;
If I want to capture STDOUT from exe1
thats simple if I redirect to a file
system("exe1 exe2 >> out"); or `exe1 exe2 1>out`;
Now the problem in this case is exe2's STDOUT will be
redirected to out file as well, what if I want output
of exe2 to go to STDOUT ?
--- Binish A R <binishar@poornam.com> wrote:
> steve tran wrote:
>
> instance)
> STDOUT,but I
> add
> mobile phone.
> Although the question isn't clear to me, I think you
> are looking for pipes ...
>
> open (FD, "|command arg1");
>
> print FD "text from STDIN goes here";
>
>
> and if you want to capture the output from this
> program, you can use ...
>
> open(FD, "command arg1|");
> @buf = <FD>;
>
>
>
> --
> *//binish//*
>
> Get Thunderbird
> <http://www.mozilla.org/products/thunderbird/>
>
>
________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|
|
|
|
|