Instead of using fancy redirection commands for output use tee which reads from standard input and writes to standard output and files.

If you want to be very thorough and have tee also handle strderr (standard error) and ensure it stays on screen,

I have yet to personally try this.


This command will only work in bash which has process substitution.


command > >(tee stdout.log) 2> >(tee stderr.log >&2)

References

How do I write stderr to a file while using “tee” with a pipe? - http://stackoverflow.com/questions/692000/how-do-i-write-stderr-to-a-file-while-using-tee-with-a-pipe