Piping into two processes simultaneously

Jim Rogers jimr at hp-lsd.COS.HP.COM
Fri Sep 7 01:48:40 AEST 1990


My solution is not elegant, but it does work:

1)	Create a fifo file (named pipe) using the mkfifo command.
	  i.e.  mkfifo foofifo

2)	Start the process(s) which write to the named pipe first.
	I found it easiest to run this part in the background.
	 i.e.  cat foo.input | tee foofifo | lp &

3)	Start the processes which read from the named pipe in the
	foreground after the background process has been started.
	 i.e.  cat foofifo | more

This will allow the data to be simultaneously printed and displayed to your
screen.

I suspect there are more elegant approaches.  I hope this note string
brings some of them out.


Jim Rogers
Hewlett Packard Company



More information about the Comp.unix.questions mailing list