On Thursday 29,December,2011 03:29 PM, lina wrote:
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,
The a.txt was the one destined to be generated, but the generation time
won't be know, which might last from 2 mins to 2 hours,
so I wish there is a script there check whether it's generate or not, if
generate, so it can proceed further.
It's a bit dynamic process, sort of .. haha ...
Thanks for your advice,
Best regards,