I know you can use tee to log output from a command in a terminal, e.g.:df -h | tee ~/log.txtHowever, how can I do this with a more complex command like this:xterm -hold -e program arg1 arg2 arg3I tried this to no avail:xterm -hold -e matlab -noxterm -nojvm -r solver('/path/to/a/folder',1) | tee ~/log.txtMy goal is to log all output of the xterm and not of the original terminal. The 
How to redirect output of a 'xterm -hold -e' command
bash;terminal;io redirection;xterm;tee