I'm looking for any improvement and suggestion on this code.
# # Count steps of collatz conjecture takes, until the number reach 1. # count_collatz_step() { step=0 if [ $1 % 2 == 0 ] then $1=$(($1/2)) step=$((step + 1)) else $1=$((3*$n+1)) step=$((step + 1)) fi echo $step } echo "Input start point: " read -n start echo "Input end point: " read -n end count=0 while [ $start -lt $end ] do echo $start + ":" + count_collatz_step $start if [ $count % 7 -eq 0 ] then echo "\n" fi start=$((start+1)) count=$((count+1)) done