下面示例是kill 名字叫modbus_master的进程
#!/bin/sh
modbus_pid=`ps -ef | grep modbus_master | grep -v grep | awk '{print $1}'`
if [ -z "$modbus_pid" ];
then
echo "[ not find modbus_master pid ]"
else
echo "find result: $modbus_pid "
kill -9 $modbus_pid
echo "modbus stoped"
fi