[comp.unix.shell] Named pipes and stdin and stdout question

oscarh@hpdmd48.boi.hp.com (Oscar Herrera) (12/18/90)

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

oscarh@hpdmd48.boi.hp.com (Oscar Herrera) (12/21/90)

Thanks to all that emailed me information about pipes.  I've solved my
problems.

Oscar Herrera

mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) (12/22/90)

In article <8720010@hpdmd48.boi.hp.com> oscarh@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@npdiss1.StPaul.NCR.COM (Dan Mercer)
"MAN - the only one word oxymoron in the English Language"