Use break command to exit from a loop after your functional requirement is done.
Example:
Following is the example with for loop.
for i in 1 2 3 4 5 doif [ CONDITION ]
then
break
else
echo "Write your function in this block"
fi
done
-Sany
Advertisements