Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Originally I used pacman, not pacman-color and I copied the output into a file and I displayed the output in the terminal with the following command :

pacman -Syu | tee file.log

Unfortunately, it seems that pacman-color detects that the output is sent to a pipe and it deactives the colored output.
So my question is how to force pacman-color to display a colored output even if the output is sent to a pipe? As with yaourt :

yaourt -Syu --color | tee file.log

Or maybe there is a way to do it without using pipe or tee?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Try this

script -c 'pacman-color -Syu' file.log

Idea taken from here.

share|improve this answer
    
Wow awesome it works !!! I had already read the question you linked but I hadn't understand the power of 'script'. And with the '-q' option is usefull to only print the command output. –  Nicolas Jan 21 '13 at 12:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.