From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 14 11:08:53 2015 Received: (at submit) by debbugs.gnu.org; 14 Nov 2015 16:08:53 +0000 Received: from localhost ([127.0.0.1]:38155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxdNl-0004JP-BB for submit@debbugs.gnu.org; Sat, 14 Nov 2015 11:08:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49536) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxdFm-00047J-To for submit@debbugs.gnu.org; Sat, 14 Nov 2015 11:00:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxdFl-0000Ly-AB for submit@debbugs.gnu.org; Sat, 14 Nov 2015 11:00:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_50,HTML_MESSAGE, MIME_HTML_ONLY autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:32911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxdFl-0000Lm-4T for submit@debbugs.gnu.org; Sat, 14 Nov 2015 11:00:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxdFk-0008Th-4G for bug-coreutils@gnu.org; Sat, 14 Nov 2015 11:00:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxdFg-0000Js-Uw for bug-coreutils@gnu.org; Sat, 14 Nov 2015 11:00:36 -0500 Received: from mout.gmx.com ([74.208.4.201]:60866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxdFg-0000JW-Mi for bug-coreutils@gnu.org; Sat, 14 Nov 2015 11:00:32 -0500 Received: from [71.202.190.80] by 3capp-mailcom-lxa02.server.lan (via HTTP); Sat, 14 Nov 2015 17:00:30 +0100 MIME-Version: 1.0 Message-ID: From: "Tim Shaw" To: bug-coreutils@gnu.org Subject: tee enhancement Content-Type: text/html; charset=UTF-8 Date: Sat, 14 Nov 2015 17:00:30 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:spBw6mIfM4bczCBwZv2g/JWsKzSbvDqK+4TTCiWSG34 RKfhUXgRc8CeMKWMNhzypuggY5Gj1DEL1xIN5luOFI8GUzhUyS mERpGyk/V2Wi1DG52ZkQOqPdb/9JLcYKVeSfbLsi70WR1R5r5A YM7cFeM/756rtWUuSzeyUwZqbTu8iOtEIbyhsN917r28LSCWuX fLrJ/ByWVfJmYqUbh6Fbq1juNrcRaXmZjuVKib1ZImB+EU6vlk ilT6as1vuFIHQmECZhyhAgjk6daWycG0FKCeng/CdfZZrXud/O 7pKIRgIYROfLMl7/phJW9X6Y93U X-UI-Out-Filterresults: notjunk:1;V01:K0:SP8+3jqE5Eo=:WwfVKwZokGmJdCIhu10oOh 9IR85JRRCvoL4dHAb/aXZfikaj1W5X3/O53083/vvsuVR3HrHjI0FXwFDyCeLWqePGShO3Cnn ZLFreoNhkZPmxVMu3se3zfx7WYKMkRuTRb+zhD47FV6nxOk0TQuyjj/HsEkDKQ2D/KbcNgy8k uzleu1pjnOp2JdspPU2GK7/e2K6vl4OWXGaIdrbv4QlMHNlByY+KJltebjrNxYDnCVNdqmktj T0NvioJCFxmbCKzHKsyKaWFPuAQERIMYeV5ty2WX9LCzI5Vl7QzyaDselZ1Gv5xHsXK0UW+Jf v13YnQ6NebVNUGOqgfi383j83+b9ZHobj1HTLLpr2S9Gk7txAkOeV8hTPKcRNAP8HnUJOx+8o 5dR4G3c6Bey8lYKhfny1nkSb7M4miT+/eN9RUAt9qqdNU2jAAOT/VrVd3AfGUTHtAsWm5eEEg 72EJQP3Ekw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 14 Nov 2015 11:08:51 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---)
If I am using stdout redirection of a shell block to capture some text I am generating, errors need to go to stderr, but it would also be good if they went into the generated output. For example
for i in files*; do
  if there_is_an_error; then
    echo big long complicated error message goes here >&2
    echo big long complicated error message goes here
    continue
  fi
   stuff_producing_text_on_stdout
done > file_i_am_creating
 
I do not like duplicating code, such as the big long error message echo. So, I could create a temp file or a temp shell var to save the message, but that makes things more complicated than just duplicating the code, and also is just not my style for something transient like this.
 
What I would like to do is add a parameter to tee, "-2", that copies to stderr in addition to stdout, just like "-" copies to stdout twice. So the code becomes
    echo big long complicated error message goes here | tee -2
Simple, eh?
 
Where's the tee source? I know this would not be POSIX compliant, but it would work for me, and I hate having to rewrite everything from scratch for trivial stuff like this.
From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 19:00:20 2015 Received: (at 21919) by debbugs.gnu.org; 16 Nov 2015 00:00:20 +0000 Received: from localhost ([127.0.0.1]:39287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy7DX-0007mU-DY for submit@debbugs.gnu.org; Sun, 15 Nov 2015 19:00:19 -0500 Received: from mail1.vodafone.ie ([213.233.128.43]:21641) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy7DC-0007kP-JG for 21919@debbugs.gnu.org; Sun, 15 Nov 2015 19:00:18 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnkFACEbSVZtT9EC/2dsb2JhbABeKAOCPlJTb8BBFwqFbAECAoEnTAEBAQEBAYELhDQBAQEDAQECDxEPAUsLCw0LAgIFFgsCAgkDAgECARYvBgEMCAEBHogEDAEIni2KK4VtigYBLIEBhFiFeYd1gUQFlkiFHYUghQ6HEJMRY4QEPjQBhUoBAQE Received: from unknown (HELO localhost.localdomain) ([109.79.209.2]) by mail1.vodafone.ie with ESMTP; 15 Nov 2015 23:59:56 +0000 Subject: Re: bug#21919: tee enhancement To: Tim Shaw , 21919@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= X-Enigmail-Draft-Status: N1110 Message-ID: <56491C7B.7090604@draigBrady.com> Date: Sun, 15 Nov 2015 23:59:55 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21919 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 14/11/15 16:00, Tim Shaw wrote: > If I am using stdout redirection of a shell block to capture some text I am generating, errors need to go to stderr, but it would also be good if they went into the generated output. For example > for i in files*; do > if there_is_an_error; then > echo big long complicated error message goes here >&2 > echo big long complicated error message goes here > continue > fi > stuff_producing_text_on_stdout > done > file_i_am_creating > > I do not like duplicating code, such as the big long error message echo. So, I could create a temp file or a temp shell var to save the message, but that makes things more complicated than just duplicating the code, and also is just not my style for something transient like this. > > What I would like to do is add a parameter to tee, "-2", that copies to stderr in addition to stdout, just like "-" copies to stdout twice. Note `tee -` now copies to a file called '-' rather than duplicating to stdout, since v8.24 as discussed at: http://lists.gnu.org/archive/html/coreutils/2015-02/msg00085.html > So the code becomes > echo big long complicated error message goes here | tee -2 > Simple, eh? > > Where's the tee source? I know this would not be POSIX compliant, but it would work for me, and I hate having to rewrite everything from scratch for trivial stuff like this. Maybe shell constructs like this would suffice? { echo error | tee >(cat >&2); } cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 19:23:41 2015 Received: (at 21919) by debbugs.gnu.org; 16 Nov 2015 00:23:41 +0000 Received: from localhost ([127.0.0.1]:39306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy7a9-0008JZ-FK for submit@debbugs.gnu.org; Sun, 15 Nov 2015 19:23:41 -0500 Received: from mail1.vodafone.ie ([213.233.128.43]:3931) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy7a7-0008JR-Ad for 21919@debbugs.gnu.org; Sun, 15 Nov 2015 19:23:39 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnkFAAMhSVZtT9EC/2dsb2JhbABeKAOCPlJTb8BBFwqFbAECAoEpTAEBAQEBAYELhDQBAQEDAQECDxEPAUsLCw0LAgIFFgsCAgkDAgECARYvBgEMCAEBHogEDAEInjGKK4VtigQBLIEBhFiFeYd1gUQFlkiFHYUghQ6HEJMRY4QEPjQBAQGFSAEBAQ Received: from unknown (HELO localhost.localdomain) ([109.79.209.2]) by mail1.vodafone.ie with ESMTP; 16 Nov 2015 00:23:38 +0000 Subject: Re: bug#21919: tee enhancement To: Tim Shaw , 21919@debbugs.gnu.org References: <56491C7B.7090604@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= X-Enigmail-Draft-Status: N1110 Message-ID: <5649220A.1020401@draigBrady.com> Date: Mon, 16 Nov 2015 00:23:38 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56491C7B.7090604@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21919 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag 21919 notabug close 21919 stop On 15/11/15 23:59, Pádraig Brady wrote: > On 14/11/15 16:00, Tim Shaw wrote: >> If I am using stdout redirection of a shell block to capture some text I am generating, errors need to go to stderr, but it would also be good if they went into the generated output. For example >> for i in files*; do >> if there_is_an_error; then >> echo big long complicated error message goes here >&2 >> echo big long complicated error message goes here >> continue >> fi >> stuff_producing_text_on_stdout >> done > file_i_am_creating >> >> I do not like duplicating code, such as the big long error message echo. So, I could create a temp file or a temp shell var to save the message, but that makes things more complicated than just duplicating the code, and also is just not my style for something transient like this. >> >> What I would like to do is add a parameter to tee, "-2", that copies to stderr in addition to stdout, just like "-" copies to stdout twice. > > Note `tee -` now copies to a file called '-' rather than > duplicating to stdout, since v8.24 as discussed at: > http://lists.gnu.org/archive/html/coreutils/2015-02/msg00085.html > >> So the code becomes >> echo big long complicated error message goes here | tee -2 >> Simple, eh? >> >> Where's the tee source? tee source is at http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob;f=src/tee.c > I know this would not be POSIX compliant, but it would work for me, and I hate having to rewrite everything from scratch for trivial stuff like this. > > Maybe shell constructs like this would suffice? > > { echo error | tee >(cat >&2); } Or this is simpler: echo error | tee /dev/stderr cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 20:28:31 2015 Received: (at 21919) by debbugs.gnu.org; 16 Nov 2015 01:28:31 +0000 Received: from localhost ([127.0.0.1]:39341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy8at-0001en-8c for submit@debbugs.gnu.org; Sun, 15 Nov 2015 20:28:31 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:43740) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy8aZ-0001eG-5t for 21919@debbugs.gnu.org; Sun, 15 Nov 2015 20:28:30 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 23BBE1601A7; Sun, 15 Nov 2015 17:28:10 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id KC4s99NLtBFi; Sun, 15 Nov 2015 17:28:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 351121601BE; Sun, 15 Nov 2015 17:28:09 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uzkcYapUy3Gk; Sun, 15 Nov 2015 17:28:09 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 0F59F1601A7; Sun, 15 Nov 2015 17:28:09 -0800 (PST) Subject: Re: bug#21919: tee enhancement To: Tim Shaw , 21919@debbugs.gnu.org References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <56493128.2080405@cs.ucla.edu> Date: Sun, 15 Nov 2015 17:28:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 21919 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Tim Shaw wrote: > echo big long complicated error message goes here | tee -2 How about "tee /dev/stderr" instead of a new option? "tee /dev/stderr" already works on many platforms now. We could easily arrange for it to work on the remaining platforms where it does not already work. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 20:41:04 2015 Received: (at 21919) by debbugs.gnu.org; 16 Nov 2015 01:41:04 +0000 Received: from localhost ([127.0.0.1]:39347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy8mj-000259-Nu for submit@debbugs.gnu.org; Sun, 15 Nov 2015 20:41:04 -0500 Received: from mail-ig0-f170.google.com ([209.85.213.170]:38760) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zy8V8-0001Wc-1c for 21919@debbugs.gnu.org; Sun, 15 Nov 2015 20:22:34 -0500 Received: by igbxm8 with SMTP id xm8so47306213igb.1 for <21919@debbugs.gnu.org>; Sun, 15 Nov 2015 17:22:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MFUdhvzK6JSwMdqW1LuYTs3CM7G+k7GSASQF6ImEL7s=; b=l8wZdlS7gPsuLyjSJqOg1daEZgEqhXuG2Sr1wE2UkhRh21HkbhrAvqyuDCkKqeQdsw T74S3x3vyqviB37YBQ/IEwuFT0vZy6RVj2NZWWtv+0D7r1CawS0+/ZObHg16Wvrvl76k jsBn7OF/Hq3ZfndNIMU9g2dyW/VV0CGhnqXVF5LGQLyjvn3kNdHtA/jjOJAaFfYPJgTo zUbs+o3NB8rvPR3oZsqvZfK461sbq5B3fmiYvmm9+6C1Tf45kMD9kmjwwxEqiCAszb2h 2+Lc96wxz27QqWTDvl14iSGRyzc5UJUaz7GcrSI9KGrNHloyBeIWc5axMrJZYMUd8WYN Rw9g== MIME-Version: 1.0 X-Received: by 10.50.225.105 with SMTP id rj9mr14515123igc.55.1447636953201; Sun, 15 Nov 2015 17:22:33 -0800 (PST) Received: by 10.36.73.222 with HTTP; Sun, 15 Nov 2015 17:22:33 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Nov 2015 02:22:33 +0100 Message-ID: Subject: Re: bug#21919: tee enhancement From: isabella parakiss To: Tim Shaw Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21919 X-Mailman-Approved-At: Sun, 15 Nov 2015 20:40:44 -0500 Cc: 21919@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 11/14/15, Tim Shaw wrote: > If I am using stdout redirection of a shell block to capture some text I am > generating, errors need to go to stderr, but it would also be good if they > went into the generated output. For example > for i in files*; do > if there_is_an_error; then > echo big long complicated error message goes here >&2 > echo big long complicated error message goes here > continue > fi > stuff_producing_text_on_stdout > done > file_i_am_creating > > I do not like duplicating code, such as the big long error message echo. So, > I could create a temp file or a temp shell var to save the message, but that > makes things more complicated than just duplicating the code, and also is > just not my style for something transient like this. > > What I would like to do is add a parameter to tee, "-2", that copies to > stderr in addition to stdout, just like "-" copies to stdout twice. So the > code becomes > echo big long complicated error message goes here | tee -2 > Simple, eh? > > Where's the tee source? I know this would not be POSIX compliant, but it > would work for me, and I hate having to rewrite everything from scratch for > trivial stuff like this. tee /dev/stderr --- xoxo iza From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 02:06:24 2015 Received: (at 21919) by debbugs.gnu.org; 16 Nov 2015 07:06:25 +0000 Received: from localhost ([127.0.0.1]:39451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZyDrs-0002g0-IH for submit@debbugs.gnu.org; Mon, 16 Nov 2015 02:06:24 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:60692) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZyDrq-0002fs-Nb for 21919@debbugs.gnu.org; Mon, 16 Nov 2015 02:06:23 -0500 Received: from [192.168.101.10] ([217.86.71.157]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0LoMIP-1aZEe22jjF-00gIZf; Mon, 16 Nov 2015 08:06:19 +0100 Subject: Re: bug#21919: tee enhancement To: Tim Shaw , 21919@debbugs.gnu.org References: From: Bernhard Voelker Message-ID: <5649806A.5020403@bernhard-voelker.de> Date: Mon, 16 Nov 2015 08:06:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Nqw2ontcmaZcrKuq1w45/En8MuUd+rwJ/xz2U+YTb1KiKZdiZ7/ FKaUbnPW0u72EnKFm+xgTi64+QgQ33fSl68g0oTFrgoi0QLJUIyYpBt950RrwNBasd7Fz3C 3xpMCMYYX+c03sg+v5/YAiT5jMuD4KGKoJRlwrOkcnOfBhlbUHFHQEVYRJuCmTrISJkwqJr CLAYSKT0D+ElLulJQvkxQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:lyb4/cbgxpA=:5uipweEqGoC1/0TDWUH+7H a40CiI3uMNPw2mvArG6j02cipAMS1lgXvcA41UDdteisVQVClXvFwtpuKXIKghQyOsMiNyb/V CSa/i8Ycy3eiiCNEnrGn9lP6f7WObky+wFPgxOpZvBhw5qkh3RZL/tTmDRG0u07zMy0ayVNgH qiM4kBWHN9mqBjJ6Hz+ajwKjEJmYpAEApDaOnK1/GXQRyy9mz6UYhiHu8rFPjNW9vJyi/R+l0 BLRm3LymI1kLdqpY0dfTQjPTriMg0eQoncarFTPs1/RQjJZKEwm1TGsTl6L315Ep1Ns0oOtnu 7ekTVSTvq+tlwsBNYguWEOu1NRCoXDgnwY3Jt9n8XrJ04DotqWpfS/xCmeriorlcKmGIIVeOS 5wy27xHIpQ0LuEyuCHWbtCQU1jMRNzd9g5k3Qb6WUu8O7NOK6JEOOaCA9WsYJEg0bZYX/nKbQ hkYGclDtz6542BBkf3iHyiCyfv5jkNWTk3HQXHgdnmwhqMdBrQ4/ja3ZAjDMesvEGB4P3V/9X wrLpqpxo4hSfcQl+Na6MiNCvdVy7QkUIMffGymtefi2j0NbS0hBH5f4KZ/Bzgd1+C7g/W9mpA 1bjC7hcRLISouPMzBDASYJKbCAanMkD1C2CisV+V1fFXpmNlWPi5lCoELbtJzbJuZyKWOT1Dw FGgcLrsNjnnV1VW6/rndUcyFuoeWjxKywHdH+ksVApguu3jOj5WXWA1bogv89NcEWK7au+Mwc p5LN8P/pxbo62WlF X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21919 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 11/14/2015 05:00 PM, Tim Shaw wrote: > What I would like to do is add a parameter to tee, "-2", that copies to stderr in addition to stdout, just like "-" > copies to stdout twice. So the code becomes > echo big long complicated error message goes here | tee -2 > Simple, eh? Having an additional option to refer to a certain file descriptor sounds worthwhile and tempting. OTOH, you can already refer to /dev/stderr as a file name for the 2nd file descriptor already on many/most systems: echo big long complicated error message goes here | tee /dev/stderr Does this work for you? > Where's the tee source? I know this would not be POSIX compliant, but it would work for me, and I hate having to rewrite > everything from scratch for trivial stuff like this. http://git.savannah.gnu.org/cgit/coreutils.git/tree/README-hacking Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 24 17:19:58 2018 Received: (at control) by debbugs.gnu.org; 24 Oct 2018 21:19:58 +0000 Received: from localhost ([127.0.0.1]:40732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFQZI-0006Xe-LX for submit@debbugs.gnu.org; Wed, 24 Oct 2018 17:19:57 -0400 Received: from mail-pl1-f173.google.com ([209.85.214.173]:39428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFQZH-0006XS-6r for control@debbugs.gnu.org; Wed, 24 Oct 2018 17:19:55 -0400 Received: by mail-pl1-f173.google.com with SMTP id e67-v6so2813719plb.6 for ; Wed, 24 Oct 2018 14:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=Pjp1D7Z9ob4b2kOBov6dsm1e0ug7IcctPzTtKqIu8mQ=; b=pAhymkznSy6hq/cH0OGOdpbvBLqVBh6czZYvgH4pU1j7IEUIijlShelCz04XXIKPGg SxqNjoRnqZ7Gv5dStNPstS/dm1FjQR+Jn7tWJARGp2mLIxs/poLpoAd/qkXhjAy5IZHe kzgZbMKFI3AHMmU9IYeW5J6M10d3JI/NkRvdndCb1SM6jf3ldAct9CIYzv69LhApLmtQ uzLZgq0hiqnvWIfL8hnYYYKs4kJB1BknErEZsn+wdMG5vNYEoBCToTpc/+T8V7OT0DQb vrHFbib2kn1BlP3hllLLx+bR9Otc+hfZBRL659zSIZWQKNNBg7uo9vORWhh8H+eYBUoo pGNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Pjp1D7Z9ob4b2kOBov6dsm1e0ug7IcctPzTtKqIu8mQ=; b=ulY7EUsjrQ3Qm9SrZ+PZ3vlY1tWbPzxBqZzW9e5vTBcky2U5h24c6DJXeg+75cT5ry XPXyeQ4DrZfXgprHWZ5W2z5TAuakw9rTjhHcvWEaXTWqV+4cGTBb+MexMrj4bxRbJoPh gmpjb0yr1pKFJvRwPS8XMslgucH+ZeUKtbiUUqWM4KzZtbQITxndFNgRnlOPrwrMZJ0s tk4/xChhOCYJHGNcVzj6XIPcuDegLrdnnhfe4s3/aq4Gze/f7Lrt3n74HTnHETbAvHWo 7wirAZLiBZE5Cvr8e+Wgsfhy23/tXUMrRgWkfrJBkiMzqM+xnX1mQSMBWTLuAQbeySC1 z59Q== X-Gm-Message-State: AGRZ1gJOPMyosee5Rxiy2Kh9PhLN50JMR/Ay1pXd0WZcm4OPh4eJsZpG 0wApRokv3LWPQp3Dk5a62L2xhL+RzWA= X-Google-Smtp-Source: AJdET5ealEix/5m1l88SyDP+bLe0jzh/KsIknW1QmQfOmUmYpoQL7mFnNzQHhgLKjZx2o2OX+B6LTw== X-Received: by 2002:a17:902:b091:: with SMTP id p17-v6mr4009613plr.182.1540415988851; Wed, 24 Oct 2018 14:19:48 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id l16-v6sm12363269pfj.179.2018.10.24.14.19.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 14:19:47 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <498170f2-d8b3-5fa0-7dc7-c99ba5081e38@gmail.com> Date: Wed, 24 Oct 2018 15:19:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 21919 notabug close 21919 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.173 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 21919 notabug close 21919 From unknown Mon Aug 18 00:33:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 22 Nov 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator