I am trying to check if a process is running with the code below:
SERVICE=\"./yowsup/yowsup-cli\" RESULT=`ps aux | grep $SERVICE` if [ \"${RESULT:-null}\" =
Use pgrep:
if pgrep "$SERVICE" >/dev/null 2>&1 ; then echo "$SERVICE is running" fi
or, more reliable:
if pgrep -f "/path/to/$SERVICE" >/dev/null 2>&1 ; then echo "$SERVICE is running" fi