#!/bin/bash tmp=`pgrep -a syslog | grep -v ${0##*/}` output_lines=`echo "$tmp" | wc -l` if (( output_lines < 1 )); then echo ERROR NO SYSLOG DAEMON IS RUNNING: echo "$tmp" elif (( output_lines > 1 )); then echo ERROR MORE THAN ONE SYSLOG DAEMON IS RUNNING: echo "$tmp" else echo $tmp fi