help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] how to set up a repeat check procedure?


From: lina
Subject: Re: [Help-bash] how to set up a repeat check procedure?
Date: Thu, 29 Dec 2011 15:53:17 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16

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,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]