#!/bin/bash
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
}
while true; do
echo 'I am working!'
sleep 1
done
#!/bin/bash
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
}
while true; do
echo 'I am working!'
sleep 1
done