buildkernel w/less verbose output

Hi everyone,

My apologies, I think this is the right forum since it doesn't seem specific to one of the other forums. I'd like to know if there's a way when rebuilding my kernel or world, can I dispense with the CC echos and what not and just get warning and error messages? Ty for any help you guys can provide.
 
This is why you should make sure to become familiar with the shell you're working in, and get a grasp on redirection. Either using a pipe | or just redirecting output using >. Of course together with the impact of /dev/stdout, /dev/stderr and /dev/null.

In other words: just redirect the output you don't want and/or need.

So... when using /bin/sh you can redirect /dev/stdout using > and redirect /dev/stderr using 2>. See also sh(1), in specific the section about Redirections. Oh, and you also want to know about file descriptors, see fd(4) for that, or just "cheat" by peeking:
Code:
peter@bsd:/home/peter $ ls -l /dev/stdout /dev/stderr
lrwxr-xr-x  1 root wheel 4 May 13 08:39 /dev/stderr@ -> fd/2
lrwxr-xr-x  1 root wheel 4 May 13 08:39 /dev/stdout@ -> fd/1
See? /dev/stderr is actually /dev/fd/2, thus we know the file descriptor we need to catch is 2.

Thus: # make buildworld > /dev/null, this would only output errors. But why stop here? ;)

# make buildworld > /dev/null 2> /root/world-errors.log && touch /root/world.done.

... this would build the world without output, and neatly catch any error messages in /root/world-errors.log. In addition you'll also get a "semaphore" as soon as the build completes successfully.
 
Back
Top