The point is to show how to write unix shell script. So I wrote the menu by using function. You can just fill in the sub menu function for a, b, c, and d which should be quite straight forward.
Hope this helps
#!/bin/bash
# simpmenu, A very simple menu
# menu() defines a function to display menu
menu () {
# clear the screen
clear
echo
echo "a. Add a user"
echo "b. Delete a user"
echo "c. Reset a password"
echo "d. Check Disk Quota"
echo "e. Exit"
echo Select by pressing a number and then ENTER ;
}
# A function that asks the user to press enter
# and waits for the ENTER Key
PressEnter () {
echo Press Enter
read x
}
#
# Function for adding user
#
adduser () {
#
# put your adduser code below
#
PressEnter
}
#
# Function for user deletion
#
deleteuser ()
{
#
# put your delete user code below
#
PressEnter
}
#
# Function for reset password
#
resetpassword () {
#
# put your reset password code below
#
PressEnter
}
#
# Function for displaying disk quota
#
diskquota () {
#
# put your code below to display disk quota
#
PressEnter
}
while true
do
# 1. display the menu
menu
# 2. read a line of input from the keyboard
read answer
# 3. Execute one of the defined functions based on the
# number entered by the user.
case $answer in
a) adduser ;;
b) deleteuser ;;
c) resetpassword ;;
d) diskquota ;;
# If the user selects 0 to exit then break out
# of this loop
e) break ;;
esac
done
# Clear the screen on the way out
clear