{"categories":["bash"],"blog_url":"https://a4dosanddos.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa4dosanddos.hatenablog.com%2Fentry%2F2015%2F08%2F02%2F164624\" title=\"\u300cbash\u300d\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e PID \u3092\u53d6\u5f97\u3059\u308b - \u30d7\u30ed\u30b0\u30e9\u30e0\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","description":"$! \u3092\u4f7f\u3046\u3068 bash \u3067\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e PID \u304c\u53d6\u5f97\u3067\u304d\u308b\u307f\u305f\u3044\u3067\u3059\u3002 * test.sh #!/bin/sh ./sleep A & ./sleep B & echo $! wait * \u5b9f\u884c\u7d50\u679c 6356 A:6355 B:6356 * sleep.c #include <stdio.h> #include <unistd.h> void main(int argc, char *argv[]) { sleep(1); printf(\"%s:%d\\n\", argv[1], getpid()); } \u4e0a\u8a18\u306e\u7d50\u679c\u306e\u901a\u308a\u3001\u8907\u6570\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u8d77\u52d5\u3059\u308b\u3068\u3001\u6700\u5f8c\u306b\u8d77\u52d5\u3057\u305f\u2026","author_name":"a4dosanddos","version":"1.0","width":"100%","provider_name":"Hatena Blog","published":"2015-08-02 16:46:24","image_url":null,"author_url":"https://blog.hatena.ne.jp/a4dosanddos/","height":"190","blog_title":"\u30d7\u30ed\u30b0\u30e9\u30e0\u65e5\u8a18","url":"https://a4dosanddos.hatenablog.com/entry/2015/08/02/164624","title":"\u300cbash\u300d\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e PID \u3092\u53d6\u5f97\u3059\u308b","type":"rich"}