#!/usr/local/bin/bash # # dos-like commands version 2. # This script shows how to use a case comand # # define the prompt string prompt="Unix for dos-weenie help system> "; # display the prompt echo -n $prompt # while we get more input (until ^D) # read a command in to the variable cmd while read cmd do # check for know commands - if we find one # start up the right man page case $cmd in dir) man ls;; copy) man cp;; rename) man mv;; del) man rm;; help) man man;; *) echo I dont know;; esac # done with that command, send the prompt echo -n $prompt done // clean up by forcing a newline echo