Looping with Numbers

  • + 0 comments

    limit=50

    Define a variable to start the loop

    num=1

    Loop until num reaches the limit

    while [ limit ] do # Print the current value of num echo $num

    # Increment num by 1 for the next iteration
    ((num++))
    

    done