Created
November 14, 2022 09:04
-
-
Save wirwolf/19481d4a426d80aa3b55c345c31465c5 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
trap trap_exit SIGINT | |
trap trap_exit SIGQUIT | |
trap trap_exit SIGTSTP | |
trap_exit() { | |
echo "trap signal: sleep 3 and exit" | |
sleep 3 | |
echo "Bye..." | |
exit | |
} | |
echo "---------------------------------" | |
echo " MAIN PROCESS" | |
echo "---------------------------------" | |
count=0 | |
while [ $count -lt ${BASH_WHILE_COUNT:-100} ] | |
#for i in {1..100} | |
do | |
(( count++ )) | |
sleep ${BASH_SLEEP_TIME:-1} | |
echo "I: ${count}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment