OILS / spec / testdata / builtin-trap-exit.sh View on Github | oilshell.org

13 lines, 6 significant
1kill=$(command -v kill)
2
3# Why don't other shells run this trap? It's not a subshell
4$SH -c 'trap "echo on exit" EXIT; sleep 0.2' &
5
6sleep 0.1
7
8# Note: this is SIGINT, for the KeyboardInterrupt problem
9$kill -INT $!
10
11wait
12
13echo status=$?