1 ## oils_failures_allowed: 2
2 ## compare_shells: dash bash mksh zsh
3
4 # Tests for builtins having to do with killing a process
5
6 #### Kills the process with SIGTERM
7 # Test 1: Basic SIGTERM
8 sleep 0.1 &
9 pid=$!
10 builtin kill -15 $pid
11 wait $pid
12 echo $? # Should be 143 (128 + SIGTERM)
13 ## STDOUT:
14 143
15 ## END
16 # For some reason mksh doesn't return the same as the others.
17 ## OK mksh stdout: 0
18 ## OK dash stdout: 0
19
20 #### Kills the process with SIGKILL
21 # Test 2: Basic SIGKILL
22 sleep 0.1 &
23 pid=$!
24 builtin kill -9 $pid
25 wait $pid
26 echo $? # Must be 137 (128 + SIGKILL)
27 ## STDOUT:
28 137
29 ## END
30 ## OK dash stdout: 0