Created
May 4, 2023 14:46
-
-
Save alterisian/b04b27b60705d1aa7be4c5c79d1ac6e9 to your computer and use it in GitHub Desktop.
A shell script that will run the passed in command every 25 (DELAY_TIME) seconds.
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
#!/bin/bash | |
# check if parameter is passed | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <command>" | |
exit 1 | |
fi | |
# set the delay time (in seconds) | |
DELAY_TIME=25 | |
# run the command every DELAY_TIME seconds and echo it | |
while true; do | |
echo "Running: $1" | |
$1 | |
sleep $DELAY_TIME | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment