to determine wether a process is running or not

#!/bin/sh
var1=`ps -ef | grep -v grep | grep process_name| awk ‘{print $2}’`
echo $var1
if [ -n $var1 ]
then
echo “The Process is Running”
else
echo “The process is not running”
fi

Tags: , , , , , ,