open command that pipes both in and out 
Author Message
 open command that pipes both in and out

I need to filter some data through another program, so I need to
open the command write to it and read the result back.  The camel
book says that "You may not have an open coomand that pipes both in
and out, though it is easy to build one using the _pipe_ and _fork_
commands."  Well, could somebody tell me how to build this....  I
have tried anything and everything I can think of, but nothing.

As an example of the type of problem, using (say) "sort":

open(SORT, "| sort |");

close(SORT);

Obviously this doesn't work, but that is the type of thing I need.  Any help
would be *greatly* appreciated.  This is the only stumbling block left in
some code I need to get up.

Tim Irvin

p.s.:  If you would answer in e-mail, I'd appreciate it.  If I get a number
of replies I'll summarize.



Tue, 29 Mar 1994 23:36:52 GMT  
 open command that pipes both in and out

:I need to filter some data through another program, so I need to
:open the command write to it and read the result back.  

If anyone else also wonders about this, you can check out the
FAQ under question #20.

--tom



Fri, 01 Apr 1994 02:43:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. piping command output to open()

2. Opening a pipe to a command

3. open a piped command including stderr

4. open COMMAND with a pipe

5. unix command displayed when using PIPES with open.

6. Killing a pipe-opened command in Win32?

7. Piping in stderr when creating a pipe with the open call

8. PERLFUNC: open - open a file, pipe, or descriptor

9. PERLFUNC: open - open a file, pipe, or descriptor

10. Perl's open() pukes when trying to open a read-type pipe

11. HELP: Piping shell command into perl command?

12. open(PIPE,"| command |") -- pipe & fork?

 

 
Powered by phpBB® Forum Software