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.

How can I redirect output from MAKE i such a way that I get only --silent output to screen, but full MAKE-output to a log file?

Or can this be achieved through some sdout/stderr redirection magic?

share|improve this question
    
I don't think I understand your question fully. Doesn't 'make > log' work well enough? –  Mat Mar 19 '11 at 16:03
2  
I do not think that's a good question... if you want full output to the file, then use make > file.log 2>&1 and you'ill get a "--silent" output to screen. This is a very basic shell usage. –  D4RIO Mar 19 '11 at 16:36
    
@D4RIO - worth being an answer, not a comment:-) –  Rory Alsop Mar 20 '11 at 0:19

2 Answers 2

make > log-file 2>&1

or

make 2>&1 | tee log-file | filter

Where filter is a program that passes only what you want to see. Use grep or sed or something else.

share|improve this answer
    
+1 I hadn't run across tee before. Thanks! –  David Oneill Mar 23 '11 at 16:18
    
to @David Oneill On linux you can also do make | tee /dev/stderr | filter > filtered-log this does the opposite. But /dev/stderr, /dev/stdout, /dev/stdin, /dev/fd/* is not available on all systems. –  richard Mar 23 '11 at 17:12

This was answered before with a comment:

if you want full output to the file, then use make > file.log 2>&1 and you'ill get a "--silent" output to screen. This is a very basic shell usage.

and 4 days have passed, i think that it no longer need to be responded.

share|improve this answer
    
That's not what the question requested, though. make --silent doesn't print the commands as they are executed (as if they were all prefixed by @), but you still get their output. –  Gilles Mar 23 '11 at 21:12
    
1st: The other answer was just a copy of the command 2nd: I was very clear in saying "if you want full output to the file", requesting edition for and you'ill get a "--silent" output to screen would be better since my comment has 2 'great comment' votes and a request to put it as answer. What we want are answers, so try to help. –  D4RIO Mar 23 '11 at 22:10
    
It seemed a bit harsh to vote this down. It was already a comment, before I added my answer. My answer just is an incremental improvement. It does not deserve a negative score, so I bumped it back up to 0. –  richard Mar 24 '11 at 9:19

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.