Skip to content

Instantly share code, notes, and snippets.

@adililhan
Created September 23, 2023 17:59
Show Gist options
  • Save adililhan/aaf7fbb9ae8060f4ba474e0a60ea5fac to your computer and use it in GitHub Desktop.
Save adililhan/aaf7fbb9ae8060f4ba474e0a60ea5fac to your computer and use it in GitHub Desktop.
#!/bin/bash
trap control_c INT
trap control_z TSTP
function control_c() {
echo "Interrupt detected - CTRL+C"
}
function control_z() {
echo "Interrupt detected - CTRL+Z... Exiting"
exit 0
}
for i in `seq 1 86400`; do
sleep 1
date
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment