I have a script that runs like this [1]:

can I insert another grep test 'stuff3'
and, stop processing with an 'exit', between stuff and stuff2?

like these 3 lines in [2] marked '=>'

[1]-------------
..snip..

    if [ -s /home/voytek/part2 ] ; then

        if grep -q "stuff" part2; then

            if grep 'stuff2' part2; then
              ..snip..
            fi
          mail -s "OK" voy...@sbt.net.au < oncall.txt
        fi
    fi
  done

exit 0

[2]--------------
..snip..

    if [ -s /home/voytek/part2 ] ; then

        if grep -q "stuff" part2; then
=>             if grep -q "stuff3" part2; then
=>             exit
=>             fi
            if grep 'stuff2' part2; then
              ..snip..
            fi
          mail -s "OK" voy...@sbt.net.au < oncall.txt
        fi
    fi
  done

exit 0


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to