Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Colorized output when piping to tee
Date: Mon, 18 Dec 2017 20:27:13
Message-Id: 20171218202621.GA26975@waltdnes.org
In Reply to: [gentoo-user] Colorized output when piping to tee by Ramon Fischer
1 On Mon, Dec 18, 2017 at 07:46:16PM +0000, Ramon Fischer wrote
2 > Hi there,
3 >
4 > I am looking for a way to have a colorized output when piping to tee, e.g.:
5 >
6 > /usr/bin/emerge --ask --update --deep --newuse --tree --verbose @world | tee --append nom.txt
7 >
8 > I already tried installing "dev-tcltk/expect" which should actually contain "unbuffer" which can help me out. But there is no unbuffer command.
9 >
10 > Am I missing something or is there any other way to do that?
11
12 From "man emerge"
13
14 --color < y | n >
15 Enable or disable color output. This option will override
16 NOCOLOR (see make.conf(5)) and may also be used to force color
17 output when stdout is not a tty (by default, color is disabled
18 unless stdout is a tty).
19
20 So you'd want...
21
22 /usr/bin/emerge --color y --ask --update --deep --newuse --tree --verbose @world | tee --append nom.txt
23
24 Insert "--color y" into the command.
25
26 --
27 Walter Dnes <waltdnes@××××××××.org>
28 I don't run "desktop environments"; I run useful applications