Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 2006 12:40:25 GMT
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/99585: [PATCH] Add option to tee(1) to also copy to standard error
Message-ID:  <200606291240.k5TCeP5U067056@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/99585; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: Dan Ponte <dcp1990@neptune.atopia.net>
Cc: FreeBSD-gnats-submit@freebsd.org, dan@theamigan.net,
        freebsd-bugs@freebsd.org
Subject: Re: bin/99585: [PATCH] Add option to tee(1) to also copy to standard
 error
Date: Thu, 29 Jun 2006 22:35:57 +1000 (EST)

 On Wed, 28 Jun 2006, Dan Ponte wrote:
 
 >> Description:
 > 	I recently found myself in a situation where having tee(1) copy to standard error and standard output at the same time would be useful, so I implemented it.
 >> How-To-Repeat:
 > 	Find yourself in said situation.
 >> Fix:
 > 	Diff below.
 
 Why not use a standard utility (tee itself in this case)?
 
    genoutput | tee /dev/stderr | tee foo
 
 copies the stdout of `genoutput' to stderr and to file foo.  This can be
 generalized to any number of copies on any numbers of file descriptors
 or files.
 
 The main problem with the utility method is is that the plumbing is
 very confusing even for only one extra pipeline stage.  /dev/stderr
 in the above refers to the initial stderr so it isn't affected by
 redirection unless the pipeline stages are run in subshells.  Running
 some of the stages in subshells makes the plumbing even more confusing.
 
 Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606291240.k5TCeP5U067056>