Created
September 4, 2013 17:40
-
-
Save blasterpal/6440244 to your computer and use it in GitHub Desktop.
pid watcher and then do something
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| pid = ARGV[0] | |
| puts "watching and waiting for pid #{pid} to complete" | |
| while `ps --no-headers #{pid}`.size > 0 | |
| puts "pid lives, waiting" | |
| sleep 10 | |
| # try again | |
| end | |
| # do something now, notify,etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment