-
-
Save Thann/71aada0f983f0225b1847c63057e9295 to your computer and use it in GitHub Desktop.
Runs a command, then kills it after a specified amount of time.
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 | |
# Runs a command, then kills it after a specified amount of time. | |
# USAGE: run4 10m watch date | |
${@:2} & PIDD=$!; | |
sleep "$1"; | |
# echo "==== STOPPED ===="; | |
kill -INT $PIDD; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment