bash for loop over 5 times code example Example: bash while loop n times for (( i=0; i<10; ++i)); do [ -e filename ] && break sleep 10 done