Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@natanlao
Created September 15, 2019 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natanlao/16203ea3627710f26b5fe486c46c8ab4 to your computer and use it in GitHub Desktop.
Save natanlao/16203ea3627710f26b5fe486c46c8ab4 to your computer and use it in GitHub Desktop.
Caffeinating a process that is already running
bash-3.2$ caffeinate -d $(while true; do if ! kill -0 $PID; then sleep 5; exit; fi; done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment