Документ взят из кэша поисковой машины. Адрес оригинального документа : http://comet.sai.msu.ru/UNIXhelp/scrpt/scrpt2.6.3.html
Дата изменения: Fri Jan 17 12:43:20 1997
Дата индексирования: Tue Oct 2 01:15:30 2012
Кодировка:
The while and until statements

The while and until statements

The while statement has the general form:

   while command-list1
   do
     command-list2
   done 

The commands in command-list1 are executed; and if the exit status of the last command in that list is 0 (zero), the commands in command-list2 are executed.

The sequence is repeated as long as the exit status of command-list1 is 0 (zero).

The until statement has the general form:

   until command-list1
   do
     command-list2
   done

This is identical in function to the while command except that the loop is executed as long as the exit status of command-list1 is non-zero.

The exit status of a while/until command is the exit status of the last command executed in command-list2. If no such command list is executed, a while/until has an exit status of 0 (zero).


[Home] [Search] [Index]