bash - shell script meaning -
ei want understand issue process; it's not giving count when 1 process running. directly going in echo "no qms process found running on $pwd" condition.
qms_process=`ps -ef | grep $pwd/qms_kernel | grep -v grep | cut -f6 -d' '` qms_process_count=`echo $qms_process | egrep [0-9] | wc -c` if [ $qms_process_count -eq 0 ] echo "no qms process found running on $pwd" else kill -15 $qms_process echo "qms process $qms_process stopped on $pwd" fi can 1 please me understanding in this.
what approach:
qms_process=`pidof "$pwd/qms_kernel"` if [ -z "$qms_process" ]; echo "no qms process found running on $pwd" else kill -15 $qms_process echo "qms process ($qms_process) stopped on $pwd" fi
Comments
Post a Comment