<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>wantata222</author_name>
  <author_url>https://blog.hatena.ne.jp/wantata222/</author_url>
  <blog_title>合縁奇縁</blog_title>
  <blog_url>https://wantata222.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>pgrepで子プロセスのIDを取得して、 再帰的に同様のことを繰り返し、子プロセスがいない親プロセスIDを killすることで順番としては最下層の子プロセスからkillする作りです。 まぁもっと良い方法があるのかもしれないですがね。 #!/bin/bash function f_kill_proc() { local pid=${1} local child_pid=`pgrep -P ${1}` sleep 1 if [ &quot;x${child_pid}&quot; != &quot;x&quot; ];then echo &quot;まだ子プロセス共がいるぜ。&quot; for child in ${child_pid} do echo &quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwantata222.hatenadiary.org%2Fentry%2F20091116%2F1258344557&quot; title=&quot;Linuxで再帰的に親のプロセスIDから一番最下層のプロセスから停止するスクリプト - 合縁奇縁&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-11-16 13:09:17</published>
  <title>Linuxで再帰的に親のプロセスIDから一番最下層のプロセスから停止するスクリプト</title>
  <type>rich</type>
  <url>https://wantata222.hatenadiary.org/entry/20091116/1258344557</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
