シェルスクリプト相談室at TECH
シェルスクリプト相談室 - 暇つぶし2ch587:デフォルトの名無しさん
07/04/23 20:32:55
kill -0 $pid 2>/dev/null || break
の方がベターだな。

>>586
man 2 kill
The kill() system call sends the signal given by sig to pid, a process or
a group of processes. The sig argument may be one of the signals speci-
fied in sigaction(2) or it may be 0, in which case error checking is per-
formed but no signal is actually sent. This can be used to check the
validity of pid.

プロセスが存在してそのプロセスにシグナルを送る権限があれば正常終了。
それ以外はエラー。つまり、プロセスの生存確認に使用できる。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch