Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Become Session Leader

By: kevincox on Nov 6th, 2012  |  syntax: Bash  |  size: 0.13 KB  |  views: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if [ $(ps -o sess= --pid $$) -ne $$ ]; then # If we are not the session leader...
  2.         exec setsid "$0" "$@"               # Become it.
  3. fi
clone this paste RAW Paste Data