github.com/benchkram/bob@v0.0.0-20240314204020-b7a57f2f9be9/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