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