public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Colorized output when piping to tee
@ 2017-12-18 19:46 Ramon Fischer
  2017-12-18 20:11 ` David Haller
  2017-12-18 20:26 ` Walter Dnes
  0 siblings, 2 replies; 3+ messages in thread
From: Ramon Fischer @ 2017-12-18 19:46 UTC (permalink / raw
  To: Gentoo User

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

Hi there,

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.

Am I missing something or is there any other way to do that?

-Ramon



[-- Attachment #2: Type: text/html, Size: 2538 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Colorized output when piping to tee
  2017-12-18 19:46 [gentoo-user] Colorized output when piping to tee Ramon Fischer
@ 2017-12-18 20:11 ` David Haller
  2017-12-18 20:26 ` Walter Dnes
  1 sibling, 0 replies; 3+ messages in thread
From: David Haller @ 2017-12-18 20:11 UTC (permalink / raw
  To: gentoo-user

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Colorized output when piping to tee
  2017-12-18 19:46 [gentoo-user] Colorized output when piping to tee Ramon Fischer
  2017-12-18 20:11 ` David Haller
@ 2017-12-18 20:26 ` Walter Dnes
  1 sibling, 0 replies; 3+ messages in thread
From: Walter Dnes @ 2017-12-18 20:26 UTC (permalink / raw
  To: gentoo-user

On Mon, Dec 18, 2017 at 07:46:16PM +0000, Ramon Fischer wrote
> Hi there,
> 
> 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.
> 
> Am I missing something or is there any other way to do that?

  From "man emerge"

   --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).

  So you'd want...

/usr/bin/emerge --color y --ask --update --deep --newuse --tree --verbose @world | tee --append nom.txt

  Insert "--color y" into the command.

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-18 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18 19:46 [gentoo-user] Colorized output when piping to tee Ramon Fischer
2017-12-18 20:11 ` David Haller
2017-12-18 20:26 ` Walter Dnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox