Listing 2: menxshell--Allows users menu access to applications
# MENXSHELL
# A Generic script to let users establish a menu access to
# applications and prevent users from directly accessing the shell.
#
# This shell is written under the Korn shell and may have to be
# adapted for other shell environments.
# Set up the trap to prevent attempts to exit from the shell using
# system breaks, i.e. ^C, ^D, etc.
trap "" 1 2 3 14 15
PATH = $PATH:/etc:/bin #customize your path as needed
#be sure to include directories
#to your applications
DBPATH=/database/dir #customize your database path
#for your system if necessary
#if not needed comment this
#statement out.
TERM=vt100 #standardize your terminal environment
#customize as necessary
#Set up any other environment parameters you may need that are
#important to your system for applications that are accessible
#through this menu
export PATH DBPATH TERM #Setting your environment parameters
while true
do
clear
echo "
MENX SHELL MENU
MAIN MENU
1.) Access Database
2.) Go to Report Menu
3.) Who is logged on
4.) Exit
Please enter your choice: "
read selection
case $selection in
1) dbms #Enter Command or shell script here to run
;; #database application
2) clear
rpt.sh #Shell script to bring up a reports submenu
;;
3) clear
user.sh #Another example of executing a shell script
;;
4) exit #Exit from the menu
;;
#Note: Continue menu as necessary
esac
done
|