I have a script and want to ask the user for some information, the script cannot continue until the user fills in this information. The following is my attempt at putting a
If anyone looking to have retry limit:
max_retry=5 counter=0 until $command do sleep 1 [[ counter -eq $max_retry ]] && echo "Failed!" && exit 1 echo "Trying again. Try #$counter" ((counter++)) done