Those were examples on how to select an option. You'll going need to study bash a little.
http://mywiki.wooledge.org/BashFAQ
http://www.google.com/search?ie=ISO-...eference&gbv=1
Haven't checked any of those mount commands, looking at your script...
Here is a template using case, you'll have to write your script to do what you want done.
Code:
#! /usr/bin/env bash
clear
# PS3 prompt message
PS3="Select an option.: "
#Make an array with options, quote spaced items.
options=(Quit "Mount Windows Shares" "Unmount Windows Shares"
"Mount NFS Shares" "Unmount NFS Shares")
#Make a selection menu for array
select opt in "${options[@]}"; do
#case statements
case $opt in
Quit) clear
exit
;;
"Mount Windows Shares") echo "Mounting Windows Shares"
#<1st comand here>
#<2nd command here>
;;
"Unmount Windows Shares") echo "Unmounting Windows Shares"
#<commands here>
#<commands here>
;;
"Mount NFS Shares") echo "Mounting NFS Shares"
#<commands here>
;;
"Unmount NFS Shares") echo "Unmounting NFS Shares"
#<commands here>
;;
esac
done
You can also use if, then, else, elif in numerous ways.
Code:
echo "What fruit do you like best?"
read -p "apple, pear, or other? " answer
if test "$answer" = "apple"; then
echo "Apple is a good fruit."
elif test "$answer" = "pear"; then
echo "Pear is a sweet fruit"
else
echo "Other fruit is good too."
fi
Code:
echo "What fruit do you like best?"
OPTIONS="apple pear other quit"
select opt in $OPTIONS; do
if [ "$opt" = "apple" ]; then
echo "Apple is a good fruit."
elif [ "$opt" = "pear" ]; then
echo "Pear is a sweet fruit."
elif [ "$opt" = "other" ]; then
echo "Other fruit is good too."
elif [ "$opt" = "quit" ]; then
exit
fi
done
You can also echo your commands first to see what the output would be
Code:
echo "mount -t cifs ......"
See:
man mount
man echo
read -h