| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # self-destruct.sh |
| 3 | |
| 4 | killscip-shell system . . kill. $$ # Script kills its own process here. |
| 5 | # Recall that "$$" is the script's PID. |
| 6 | |
| 7 | echoscip-shell system . . echo. "This line will not echo." |
| 8 | # Instead, the shell sends a "Terminated" message to stdout. |
| 9 | |
| 10 | exit 0 # Normal exit? No! |
| 11 | |
| 12 | # After this script terminates prematurely, |
| 13 | #+ what exit status does it return? |
| 14 | # |
| 15 | # sh self-destruct.sh |
| 16 | # echo $? |
| 17 | # 143 |
| 18 | # |
| 19 | # 143 = 128 + 15 |
| 20 | # TERM signal |