./compile >& filename
where the redirection symbols >& direct both the standard output (
stdout) and write error output to standard error (
stderr) to the file named filename. Sometimes you also want to see the output on the screen at the same time. This is where the Unix command tee comes in. For example the Unix commands
./compile |& tee filename
stderrto the file filename.