The UNIX Operating System

TOP

UP


Ray Seyfarth

ORCA


Computer Science

COST

USM




Loops


  • while condition-list
    do
    list
    done

  • until condition-list
    do
    list
    done

  • for name in word1 word2 ...
    do
    list
    done

  • for (( init; test;; update ))
    do
    list
    done

  • The while, until, for, do and done must start a line
    or follow a semicolon.

  • You can omit the in and word list to get a for loop to process positional parameters.


University of Southern Mississippi
Ray.Seyfarth@usm.edu
Updated 15:45 Sep 13, 2006