Looping in linux

Closed
karthik - Jan 13, 2009 at 01:24 AM
jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 - Jan 13, 2009 at 06:02 AM
Hello,
I am seeing an issue while creating the loop in linux. The script needs to verify the file in one location. if it's present then the process should be wait, if it's not present in the location, the process can start.. Could you please let me know about this issue? My observations are given below,

I tried, this

if [ -f $FILE ]; then
sleep 100
fi
echo "process"

From my obervation, want to wait till to delete the file by my process.

Thanks
-Karthik
Related:

1 response

jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 17
Jan 13, 2009 at 06:02 AM
Hi,

Try this:

while true
do
if [ -f "$FILE" ]
then
echo "$FILE is still alive"
sleep 100
continue
else break
fi
done
echo "$FILE is dead, process..."

;-))

--
$ man woman
Il n'y a pas de page de manuel pour woman.
0