Skip to content

Instantly share code, notes, and snippets.

@wirwolf
Created November 14, 2022 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wirwolf/19481d4a426d80aa3b55c345c31465c5 to your computer and use it in GitHub Desktop.
Save wirwolf/19481d4a426d80aa3b55c345c31465c5 to your computer and use it in GitHub Desktop.
#!/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