The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации

Example of using the break and continue statements

To prompt for commands to run:

   #!/bin/sh
   while echo "Please enter command"
   read response
   do
     case "$response" in
     'done') break           # no more commands
                       ;;
     "")     continue        # null command
                       ;;
     *)      eval $response  # do the command
                       ;;
     esac
   done

This prompts the user to enter a command. While they enter a command or null string the script continues to run. To stop the command the user enters done at the prompt.


[Home] [Search] [Index]



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру