启动和杀进程

1.启动进程

#!/bin/bash
source /usr/local/greenplum-db/greenplum_path.sh
PGSYSCONFDIR=/usr/local/greenplum-db/etc
export PGSYSCONFDIR
export PGCLIENTENCODING=GBK
./processname

2.杀进程

#!/bin/bash
_pid=`ps -ef | grep processname| head -n 1 | awk '{print $2}'`
echo "Killing ${_pid} ..."
kill -9 ${_pid}

你可能感兴趣的:(shell,进程)