How can this while loop be limited to maximum 10 retries?
#!/bin/sh
while ! test -d /somemount/share/folder
do
echo \"Waiting for mount /somemount/share/
I would comment but I do not have enough points for that. I want to contribute anyway. So this makes it work even if the while loop is nested in another loop. before the break the c variable is being reset to zero. credits to @anubhava who came up with the original solution.
#!/bin/sh
while ! test -d /somemount/share/folder
do
echo "Waiting for mount /somemount/share/folder..."
((c++)) && ((c==10)) && c=0 && break
sleep 1
done