1.輸入以下代碼:
#include <stdio.h>
#include <unistd.h>
int main()
{
printf("hello world: pid: %d, ppid: %d\n",getpid(),getppid());
return 0;
}
2.編譯得到可執(zhí)行程序???
3.運行得到ppid
4.輸入指令? ps axj | head -1 && ps axj | grep ppid?查找
文章來源:http://www.zghlxwxcb.cn/news/detail-624658.html
??文章來源地址http://www.zghlxwxcb.cn/news/detail-624658.html
到了這里,關于Linux--驗證命令行上運行的程序的父進程是bash的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!