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

18 lines, 6 significant
1
2# ISSUE WITH TEST: & means that trap handler isn't run!
3# I guess because the background job gets disconnected from the terminal?
4# So it doesn't need SIGINT
5
6# We need some other way to kill it with SIGINT
7
8kill=$(command -v kill)
9
10$SH -c 'trap "echo int" INT; sleep 0.2' &
11
12sleep 0.1
13
14$kill -INT $!
15
16wait
17
18echo status=$?