hide random home http://www.fmi.uni-passau.de/archive/doc/unix/unixhelp/Unixhelp/scrpt_scrpt2.6.4.1.html (Einblicke ins Internet, 10/1995)

Example of using the break and contiue statements

Example of using the break and contiue statements

1. To prompt for an run commands:

   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.