スクリプトを中断できないようにする
#!/bin/sh #trap_int.sh #INTシグナルを無視する trap 'echo "SIGINT was ignored."' INT for i in one two three four five; do echo $i sleep 1 done
$ ./trap_int.sh one two SIGINT was ignored. three SIGINT was ignored. four SIGINT was ignored. five SIGINT was ignored.