Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!engbert From: engbert@cs.vu.nl (Engbert Gerrit IJff) Newsgroups: comp.unix.questions Subject: Re: Duplicate stdin to stdout Message-ID: <8469@star.cs.vu.nl> Date: 10 Dec 90 23:08:42 GMT References: <2431@pbhyg.PacBell.COM> Sender: news@cs.vu.nl Reply-To: engbert@cs.vu.nl (Engbert Gerrit IJff) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 64 In article <2431@pbhyg.PacBell.COM>, P.F.Hendricks@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