Created
October 1, 2012 20:58
-
-
Save mertenvg/3814370 to your computer and use it in GitHub Desktop.
Nohup with command sequence
This file contains 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
# Create a test.pid file containing the pid of the sh process. | |
# Run the main command. Example: Sleep for 15 seconds. | |
# Then remove the pid file once the main command process is ended or killed. | |
$ nohup sh -c "sleep 15; rm test.pid" >/dev/null 2>&1 & echo $! > test.pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment