Nested if else

view story

http://www.unix.com – Hi, i m trying to create script which logic is like below. Code: if [ -s ${LOGFILE} ]; then x=`cat /tmp/testoutput.log | grep STOP | wc -l` y=`cat /tmp/testoutput.log | grep RUN | wc -l` if [ "$x" -gt 0 ]; then echo "process stop" if [ "$y" -gt 0 ]; then echo "process running " else echo "file not found" fi ---------------- This syntax does not work , could somebody suggest anyway to do it. Thanks. (HowTos)