I'm looking to repeat this code until I stop it, either by setting a time for which it repeats, pressing ^c, or set number of iterations, and then output the result of repeating it. The code should feed into itself, such that inputting the variables 5 and 2 the first time would result in restarting the script with 5 and 2.25 as the variables. The script helps determine the square root of a number, with one guess.
#!/bin/bash
echo -n "Please enter the number you need to find the square root for and press [ENTER]: "
read fin
echo -n "Please enter guess and press [ENTER]: "
read gues
var=$(echo "$fin/$gues" | bc -l )
var1=$(echo "$var+$gues" | bc -l )
var2=$(echo "$var1/2" | bc -l )
echo $var2