From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 29 12:36:04 2006 Return-Path: X-Original-To: freebsd-bugs@freebsd.org Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8801C16A403; Thu, 29 Jun 2006 12:36:04 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C4A543DA1; Thu, 29 Jun 2006 12:36:04 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id CD2D76E730; Thu, 29 Jun 2006 22:36:00 +1000 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k5TCZvZi022685; Thu, 29 Jun 2006 22:35:58 +1000 Date: Thu, 29 Jun 2006 22:35:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Dan Ponte In-Reply-To: <200606281814.k5SIEouW033968@fez.theamigan.net> Message-ID: <20060629214004.W78383@delplex.bde.org> References: <200606281814.k5SIEouW033968@fez.theamigan.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org, dan@theamigan.net Subject: Re: bin/99585: [PATCH] Add option to tee(1) to also copy to standard error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2006 12:36:04 -0000 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