#
echo menu test program
set stop = 0            # reset loop termination flag
while ($stop == 0)      # loop until done
 cat << ENDOFMENU       # display menu
 1   : print the date.
 2, 3: print the current working directory
 4   : exit
ENDOFMENU
 echo
 echo -n 'your choice? '     # prompt
 set reply = $<              # read response
 echo ""
 switch ($reply)             # process response
   case "1":
     date                    # display date
     breaksw
   case "2":
   case "3":
     pwd                     # display working directory
     breaksw
   case "4":
     set stop = 1            # set loop termination flag
     breaksw
   default:                  # default
     echo illegal choice     # error
     breaksw
 endsw
end
