Named pipes and stdin and stdout question

Dan Mercer mercer at npdiss1.StPaul.NCR.COM
Sat Dec 22 05:35:43 AEST 1990


In article <8720010 at hpdmd48.boi.hp.com> oscarh at hpdmd48.boi.hp.com (Oscar Herrera) writes:
:I have a program that takes input from the keyboard and reports status
:to the screen.  I'd like to run this program such that its standard
:input comes from a named pipe and its standard output is sent to another
:named pipe.  Is this possible ?  Or, does is it necessary that the
:program programatically read/write from/to named pipes ?
:
:Oscar Herrera

Pipes block until they are opened at both ends.  Named pipes are no
exception.  I have written programs that run in background sitting on
an open (tvp - turbo vi pattern importer - I start it up in background
from my .profile.  In vi,  I type in a line of code,  for instance 
:stty

hit Pf7,  which sends the data to in input FIFO.  Tvp opens the fifo
and reads the current line from the vi file.  Vi then opens the output
fifo with a :r command.  That blocks vi.  The 'stty' string is run
through an in memory database,  matches against an array of entries,
and the matched data - all the necessaries to run character at a time
termio functions - are written to the output fifo and wind up in my
file.).

I've also written shell scripts that run 'bc' - the interactive desk
calculator - in the background.

-- 
Dan Mercer
NCR Network Products Division      -        Network Integration Services
Reply-To: mercer at npdiss1.StPaul.NCR.COM (Dan Mercer)
"MAN - the only one word oxymoron in the English Language"



More information about the Comp.unix.shell mailing list