I have a crude script the email me a text from html page, that works fine;
but, I would like to delay execution under certain condition, when it says
'delay'
so, I've introduced 'if grep delay' loop below with sleep 240
I've received 'detected' email, so, grep was OK, and loop was entered
BUT, final 'done' email was received pretty well immediately, it seems
can I use 'sleep' like I did to delay script processing ?
=====
#!/bin/bash
/snip/
if [ -s /home/voytek/test/part2 ] ; then
if grep -q "test" part2; then
if grep 'delay' part2; then
echo "wait 4min"
mail -s "detected" voytek@... < test.txt
sleep 240
fi
links -dump test.html >> test.txt
mail -s "done" voytek@... < test.txt
fi
fi
/snip/
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