Looping with Numbers

Sort by

recency

|

101 Discussions

|

  • + 0 comments

    for i in {1..50} do echo $i done

  • + 0 comments

    for i in {1..50};do echo $i;done

  • + 0 comments

    both:

    for i in {1..50}
    do
      echo $i
    done
    

    and:

    for i in {1..50}; do
      echo $i
    done
    
  • + 0 comments
    i=1
    while [[ $i -le 50 ]]
    do
    echo $i
    i=$(($i+1))
    done
    
  • + 0 comments
    for i in {1..50}
    do
        echo $i
    done