#!/bin/bash echo "hello word" # 注意这里需要用 `` job=`pidof g` res="$job" echo "最后res结果" echo "$res" echo "把 $res kill" k=`kill -9 $res ` $k