public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Haller <gentoo@dhaller.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Colorized output when piping to tee
Date: Mon, 18 Dec 2017 21:11:54 +0100	[thread overview]
Message-ID: <20171218201154.tvkftox4gi5rg62v@grusum.endjinn.de> (raw)
In-Reply-To: <AM5P195MB00674BC1177013DD2A2C563CEF0E0@AM5P195MB0067.EURP195.PROD.OUTLOOK.COM>

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


  reply	other threads:[~2017-12-18 20:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 19:46 [gentoo-user] Colorized output when piping to tee Ramon Fischer
2017-12-18 20:11 ` David Haller [this message]
2017-12-18 20:26 ` Walter Dnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171218201154.tvkftox4gi5rg62v@grusum.endjinn.de \
    --to=gentoo@dhaller.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox