Duplicate stdin to stdout

Engbert Gerrit IJff engbert at cs.vu.nl
Tue Dec 11 10:08:42 AEST 1990


In article <2431 at pbhyg.PacBell.COM>,
	P.F.Hendricks at PacBell.COM (P.F.Hendricks) writes:
) 
) I have a program that builds a script file to feed input into a program.
) My problem is that there is a possiblity of errors occuring during input
) however there is no easy way to know where the error occured.
) 
) To make things a little clearer here is an example of what I mean.
) 
) ----------------------------------------
) /usr/local/bin/buildlist << EOF
) 555-1234
) John
) Doe
) 1234 Main St.
)   .
)   .
)  (100 to 200 more entries follow)
)   .
) 555-5678
) Jane
) Zule
) 2314 Juniper Dr.
) EOF
) ----------------------------------------
) 
) There may be an entry already for 'John Doe' but all I get from the
) program 'buildlist' is "? DUPLICATE ENTRY", no name, no number, nothing.
) 
) What I would like to do is be able to duplicate the input from the script
) to the standard ouput, or a file. I've RTFM'd but and my impression is that
) it can't be done, but I've been wrong before. So I'm hoping the net wisdom
) can enlighten me, in fact I'm counting on it...
) 
) BTW - I'm running SYSV 3.1 on a 3B20.
) 
) Thank you.
) 
) -Paul
Right out of the head:
try
cat << EOF | tee | /usr/local/bin/buildlist
555-1234
	.

	.

	.

EOF

tee duplicates stdin to stdout and stderr
stdout can be redirected to a file or a pipe

however, if you want to use it to catch the duplicate
entry I fear it will not help you, because of the blocked
I/O

I have no time to RTFM right now, but maybe
there is a flag on the shell you use that will
show you the lines as they are passed to buildlist.

Hope this helps,
Bert



More information about the Comp.unix.questions mailing list