github.com/Benchkram/bob@v0.0.0-20220321080157-7c8f3876e225/tui-example/tui/script1.sh (about) 1 cleanup() { 2 echo "app interrupted" 3 exit 0 4 } 5 6 trap cleanup INT 7 8 i=0 9 echo "app running 0" 10 11 while sleep .25 12 do 13 ((i++)) 14 echo "app running $i" 15 done 16 17 echo "app exited" 18 exit 0