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

Fwd: how to check 400 files exist



Sorry to send to Darac, here forwards to list. 

Begin forwarded message:

From: lina <lina.lastname@gmail.com>
Date: 19 January, 2012 1:29:14 GMT+08:00
To: Darac Marjal <mailinglist@darac.org.uk>
Subject: Re: how to check 400 files exist

On 19 Jan, 2012, at 1:09, Darac Marjal <mailinglist@darac.org.uk> wrote:

On Thu, Jan 19, 2012 at 12:34:50AM +0800, lina wrote:
Hi,

Thanks ahead for reading this email.

I am choked by how to check more than 400 files exist or not, if not,
sleep, but once it's all generated, continue do something.

for i in $(seq 5); do if [ -e sys_em_$i.txt ] ; then echo done ; fi ;
done not work.

The problem you have here is that you don't know when a file isn't
there. Try:

Missing=0
for i in $(seq 5); do
 if [ ! -e sys_em_$i.txt ]; then
    Missing=1
 fi
done
if [ $Missing -eq 1 ]; then
 print "One or more files is missing!

Thanks, how can I return to check after sleep 10 seconds ?



Yes, I don't know when it will generate. But know it may generate in 6 hours.
Curses!"
else
 print "All files exist! Top notch!"
fi


those files have a common feature:

sys_em_$i.txt

Thanks for any advice,

Best wishes,


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] CAG9cJm=Vb2SttucGnOJPXD5BKbMaOtQSq0ZVrBfH030AdqpDcg@mail.gmail.com">http://lists.debian.org/[🔎] CAG9cJm=Vb2SttucGnOJPXD5BKbMaOtQSq0ZVrBfH030AdqpDcg@mail.gmail.com


--
Darac Marjal


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] 20120118170948.GA3664@darac.org.uk">http://lists.debian.org/[🔎] 20120118170948.GA3664@darac.org.uk


Reply to: