'peeking' in on a pipe

Maarten Litmaath maart at cs.vu.nl
Sat Jul 8 19:19:58 AEST 1989


Tim.Evans at f112.n138.z1.WA.COM (Tim Evans) writes:
\I would like to 'peek' in on a pipe, to see what is happening in it, WHILE
\IT EXECUTES. I tried something like this, but no luck:
\ 
\  some_stuff | tee `tty` | more_stuff
\ 
\I would like to do this while it executes, not tee to a file and see it
\later. Does anyone have any ideas how this might be done?

This is funny!
Did you ever ls(1) your directory after issuing the pipeline command above?
I bet you'd find three files you didn't expect:

	a
	not
	tty

stdin of the `tty` command is a pipe, hence the message "not a tty", so
tee(1) sees 3 `filenames' to duplicate stdout to!
Solution:

	foobie | tee /dev/tty | bletch
-- 
   "... a lap-top Cray-2 with builtin    |Maarten Litmaath @ VU Amsterdam:
cold fusion power supply"  (Colin Dente) |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list