4
2
When I detach command:
$ command &
The result is a printout to STDOUT:
[1] < PID >
I would like to monitor this PID. However, I cannot write this output anywhere but STDOUT! How can I redirect this to a file or a variable?
I have tried:
$ command 1> ./temp.txt &
But this still finds its way to STDOUT!
Thanks in advance for the help!
Awesome. This does not answer my exact question, but this is even better! – Daeden – 2013-07-17T06:44:25.553
Yeah, I think the problem is stdout is the output of the command you're running, but the id is coming from the shell. So to capture it with stdout you'd have to actually execute it in a subshell some how and capture the stdout of that. Just thinking out loud about what's going on, haven't tested that. – Bill Heller – 2013-07-17T14:29:53.970