获取pid并且kill

获取pid并且kill

#!/bin/bash

echo "hello word"

# 注意这里需要用 ``
job=`pidof g`
res="$job"

echo "最后res结果"
echo "$res"

echo "把 $res  kill"
k=`kill -9 $res `
$k
posted @ 2021-08-23 11:36  maob  阅读(158)  评论(0编辑  收藏  举报