linux查看某個(gè)進(jìn)程是否存在 linux判斷進(jìn)程是否存在?
linux判斷進(jìn)程是否存在?結(jié)合使用PS command和grep command來(lái)確定服務(wù)名稱是否存在:SVC=“sendmail”IFPs EF | grep$SVC | egrep vgrep&
linux判斷進(jìn)程是否存在?
結(jié)合使用PS command和grep command來(lái)確定服務(wù)名稱是否存在:SVC=“sendmail”IFPs EF | grep$SVC | egrep vgrep>/dev/nullthenecho“$svcisstarted!“elseeeecho”$svcnotfound!“fi Description:PS EF:顯示當(dāng)前正在運(yùn)行的所有進(jìn)程|:pipeline,即上一個(gè)命令的輸出,作為以下命令的輸入grepservice uuName:在輸出信息中,查找服務(wù)uName數(shù)據(jù)行egrep vgrep:不顯示grep search命令本身