From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 29 15:55:02 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 083BC16A407; Thu, 29 Jun 2006 15:55:01 +0000 (UTC) (envelope-from dcp1990@saturn.atopia.net) Received: from saturn.atopia.net (saturn.atopia.net [72.36.141.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 049D44447A; Thu, 29 Jun 2006 15:54:58 +0000 (GMT) (envelope-from dcp1990@saturn.atopia.net) Received: by saturn.atopia.net (Postfix, from userid 1004) id 43F574AC45; Thu, 29 Jun 2006 11:54:57 -0400 (EDT) Date: Thu, 29 Jun 2006 11:54:57 -0400 From: Dan Ponte To: Bruce Evans Message-ID: <20060629155456.GA15303@neptune.atopia.net> References: <200606281814.k5SIEouW033968@fez.theamigan.net> <20060629214004.W78383@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060629214004.W78383@delplex.bde.org> User-Agent: Mutt/1.5.11 Cc: freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org 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 15:55:02 -0000 On Thu, Jun 29, 2006 at 10:35:57PM +1000, Bruce Evans was witnessed plotting the following conspiracy: > 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 > Hrm...this is a good idea. I never thought about that. -Dan -- Dan Ponte http://www.theamigan.net/ -- ICQ: 175527699 Jabber: dan@styx.theamigan.net -- AIM: amiganWS/amigan940 To get something done, a committee should consist of no more than three persons, two of them absent.