Created
December 1, 2021 11:48
-
-
Save netj/02e4d43ba737df4d8ff9532de3ebd6a4 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# yeshup -- wraps given command with a parent process that sends SIGTERM upon receiving SIGHUP, the opposite of nohup | |
# See also: https://github.com/RhysU/yeshup | |
set -eu | |
pid=$$ | |
trap 'kill -TERM $pid' HUP | |
"$@" & pid=$! | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment