Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Disable colored output temporarily?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Tue May 28, 2002 8:44 pm    Post subject: Disable colored output temporarily? Reply with quote

For the most part, I like the colored console output that Gentoo uses. However, there are a few cases where it's a pain. For example, if I want to do the following:

Code:
emerge -ep package_foo > package_list.txt


I'm going to get a file full of ANSI color escape characters in addition to the expected output. I realize I can remove these fairly easily through a regex find/replace, but I'd prefer not to have to do that.

What's the easiest way to disable color output for just that command and not the entire console session?

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Tue May 28, 2002 9:46 pm    Post subject: Reply with quote

there is a variable in the /etc/make.globals called "NOCOLOR" that controls whether emerge will use color or not.

I just tested it and it successfully turned off color by doing:

Code:

export NOCOLOR=true ; emerge -pu world

No ansi escape sequences.
Is that what your looking for?

PS: after that, you can always set NOCOLOR back to false per default.
Back to top
View user's profile Send private message
Nitro
Bodhisattva
Bodhisattva


Joined: 08 Apr 2002
Posts: 661
Location: San Francisco

PostPosted: Tue May 28, 2002 9:59 pm    Post subject: Reply with quote

arkane wrote:
Code:

export NOCOLOR=true ; emerge -pu world

No ansi escape sequences.
Is that what your looking for?


Personally, I think it is better to do:
Code:
NOCOLOR=true emerge -ep world

With my method, we only set NOCOLOR for the duration of the emerge function, other wise the export will carry over till it is unset, or the shell is closed.

(klieber: this sounds like a post to submit to the Tips & Tricks forum if this is/when you find the solution.)
_________________
- Kyle Manna

Please, please SEARCH before posting.

There are three kinds of people in the world: those who can count, and those who can't.
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Tue May 28, 2002 10:13 pm    Post subject: Reply with quote

Quote:

Personally, I think it is better to do:
Code:
NOCOLOR=true emerge -ep world

With my method, we only set NOCOLOR for the duration of the emerge function, other wise the export will carry over till it is unset, or the shell is closed.


Or that way :)

I completely forgot about that functionality.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum