14 comments

[ 2.9 ms ] story [ 55.1 ms ] thread
Is this better than running the program in something like screen or tmux?
I get the impression that this is for when you've forgotten to set up something like screen beforehand.
Explained with comments: https://gist.github.com/782312 (edit: made clearer).
Nice. Thanks for that. The only addendum I would make is that the second parameter to open specifies to open the file as writable. Usually the constant is O_WRONLY, but it wasn't working for me in GDB.
Someone has rolled this into a script:

http://www.isi.edu/~yuri/dupx/

This always annoys me:

Dupx is currently implemented as a simple shell script

So why can't I just download this "simple shell script"?

Extract it from the provided tarball. Almost as easy, but with no man page.
Wow, I get that the gdb stuff is the real clever trickery, but 'disown' is the most valuable thing I got from that. I knew about nohup, but I didn't know about disown.
Disown is actually implemented by bash (or your shell of choice). From my understanding, it just stops the HUP propagating down to that child. There might be a more shell-agnostic way to assign the parent process id too.
Alternatively, if you know you're going to want to do this beforehand, check out the 'nohup' command. It does basically the same thing with any command it's given.

http://en.wikipedia.org/wiki/Nohup

Am I a bad person for using nohup and stderr/stdout redirect?

Anyway this is a really nice creative alternative.

Actually, it's not meant as an alternative, but when you forgot to use nohup or stderr/stdout redirect, ie. redirect output from an already running process.
====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

Gold autumn, personality Mes clothing + Shoes, Travel bag that grabs an eye coat + Chao packet Free transport

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====

====== ( http://u.ly/73I )====