获取pid并且kill
#!/bin/bash
echo "hello word"
# 注意这里需要用 ``
job=`pidof g`
res="$job"
echo "最后res结果"
echo "$res"
echo "把 $res kill"
k=`kill -9 $res `
$k
2023-11-25 13:37:04
#!/bin/bash
echo "hello word"
# 注意这里需要用 ``
job=`pidof g`
res="$job"
echo "最后res结果"
echo "$res"
echo "把 $res kill"
k=`kill -9 $res `
$k