6

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?

3
  • I don't think I understand your question fully. Doesn't 'make > log' work well enough? Commented Mar 19, 2011 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. Commented Mar 19, 2011 at 16:36
  • 1
    @D4RIO - worth being an answer, not a comment:-) Commented Mar 20, 2011 at 0:19

2 Answers 2

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

1
  • 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. Commented Mar 23, 2011 at 17:12
0

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.

3
  • 1
    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. Commented Mar 23, 2011 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. Commented Mar 23, 2011 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. Commented Mar 24, 2011 at 9:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.