Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failing loop

Status
Not open for further replies.

chomps303

MIS
Sep 30, 2003
83
US
Why does the following end by its self.

I need to run zz every 5 seconds if there is any *.txt file . This falls out all the time. Any suggestions.
The shell script is named import. I invoke it with ./import &

If there is another way I'm game!!

Thanks
Brandt

#pg import

while true
do
if [ -f /appl/helpstar/*.txt ]
then
/appl/scripts/zz 2>&1 > /dev/null
fi
done
sleep 5
 
Have you tried something like this ?
while [ -f /appl/helpstar/*.txt ]
do /appl/scripts/zz 2>&1 >/dev/null
sleep 5
done

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
i expect troubles here:
-f /appl/helpstar/*.txt
when *.txt is not unique
 
iribach, if *.txt is not unique, the remaining should be evaluated as non empty and therefore true.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top