From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 096FD139083 for ; Mon, 18 Dec 2017 20:12:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C58E1E10D4; Mon, 18 Dec 2017 20:12:08 +0000 (UTC) Received: from km35626.keymachine.de (unknown [87.118.86.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4F55DE100A for ; Mon, 18 Dec 2017 20:12:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by km35626.keymachine.de (Postfix) with ESMTP id D202011258D4 for ; Mon, 18 Dec 2017 21:12:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at km35626.keymachine.de. Received: from km35626.keymachine.de ([127.0.0.1]) by localhost (km35626.keymachine.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3H4WPTaWiPJO for ; Mon, 18 Dec 2017 21:12:04 +0100 (CET) Received: from grusum.endjinn.de (p3EE239D4.dip0.t-ipconnect.de [62.226.57.212]) by km35626.keymachine.de (Postfix) with ESMTPSA id 361D511258DE for ; Mon, 18 Dec 2017 21:12:04 +0100 (CET) Received: by grusum.endjinn.de (Postfix, from userid 500) id 5FAD4170392; Mon, 18 Dec 2017 21:11:28 +0100 (CET) Date: Mon, 18 Dec 2017 21:11:54 +0100 From: David Haller To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Colorized output when piping to tee Message-ID: <20171218201154.tvkftox4gi5rg62v@grusum.endjinn.de> Mail-Followup-To: gentoo-user@lists.gentoo.org References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Organization: What? X-Clacks-Overhead: GNU Terry Pratchett User-Agent: NeoMutt/20170609 (1.8.3) X-Archives-Salt: a7f5f09e-8e2f-4cf6-9f53-447ba5ba536e X-Archives-Hash: 5efc73fc1db70f8d339550c76cc75d89 Hello, On Mon, 18 Dec 2017, Ramon Fischer wrote: >I am looking for a way to have a colorized output when piping to tee, e.g.: > > /usr/bin/emerge --ask --update --deep --newuse --tree --verbose @world | tee --append nom.txt > >I already tried installing "dev-tcltk/expect" which should actually contain "unbuffer" which can help me out. But there is no unbuffer command. # qfile `which unbuffer` app-misc/unbuffer (/usr/bin/unbuffer) >Am I missing something or is there any other way to do that? unbuffer won't help you there anyway. That only changes when stuff is written to the pipe. You're actually looking for: ==== --color < y | n > Enable or disable color output. This option will override NOCOLOR (see make.conf(5)) and may also be used to force color output when stdout is not a tty (by default, color is disabled unless stdout is a tty). ===== BTW: if you don't want that colorized output in the log, add app-text/ansifilter (/usr/bin/ansifilter) for reading the log. HTH, -dnh -- MCSE: "Microsoft Certified Stupidity enclosed" -- A. Spengler