How do you create a for loop with a changeable number of iterations?
You can use seq
for i in $(seq 1 "$num")
or your shell may support C-style loops e.g. in bash
for ((i=0; i<$num; i++))
echo "how many times would you like to run your loop ?"
read max
i=0
while [ "$((i+=1))" -le "$max" ]
do
# whatever you want to do here
done