Results 1 to 3 of 3

Thread: bash question

  1. #1
    Join Date
    Jun 2009
    Location
    Land of Paranoia and Guns
    Beans
    194
    Distro
    Ubuntu 12.10 Quantal Quetzal

    bash question

    How do I loop COMMANDS X times in bash?
    Don't use W3Schools as a resource! (Inconsequential foul language at the jump)
    Open Linux Forums (More foul language, but well worth it for the quality of support and good humor.)
    If you want to discuss W3Schools, please PM me instead of posting.

  2. #2
    NoaHall is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Mar 2009
    Beans
    1,562
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: bash question

    while [ a != x ]
    do
    let a=a+1
    done

    for x in numbers
    do
    done

  3. #3
    Join Date
    Apr 2008
    Beans
    286

    Re: bash question

    This command gets the job done every time:
    Code:
    man bash > bash-help.txt; gedit ./bash-help.txt; rm ./bash-help.txt
    But for your specific query, try this:
    Code:
    #!/bin/bash
    for (( i=0 ; $i<10 ; i++ )); do
      echo $i
    done
    Peace

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •