[Help-bash] how to set up a repeat check procedure?
From:
lina
Subject:
[Help-bash] how to set up a repeat check procedure?
Date:
Thu, 29 Dec 2011 15:29:57 +0800
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16
Hi,
How can I let a script keep on checking whether a file exist or not?
if not, check it again 1 minutes later,
if exist, execute some commands,
I started writing the
#!/bin/sh
file=a.txt
if [ -e $file ]; then
echo "$file exists"
else
sleep 60
## I don't know how to let it back to check,
fi
Thanks with best regards,