Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Forked from zaius/background.sh
Created January 18, 2011 08:51
Show Gist options
  • Save eklitzke/784151 to your computer and use it in GitHub Desktop.
Save eklitzke/784151 to your computer and use it in GitHub Desktop.
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
detach
quit
# Back in shell
disown
logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment