I have a few sets of scripts that I've written to make setting up linux very simple. So I have made those scripts into separate functions instead and put it all in one script. I have numbers set so when the user inputs one of the numbers, it will call that function. However, when the user inputs one number, the script calls ALL the functions:
n=1
#note you need spaces between [ ]
while [ $n == 1 ]
do
echo "Base install=1"
echo "Mintrepos=2"
echo "Asusn13 driver=3"
echo "Install Standard openbox=4"
echo "Install Xfceopenbox=5"
echo "backing up standard open box config=6"
echo "backing up openboxfce=7"
echo
read choice
if [ "$choice"==1 ]
then
baseinstall
fi
if [ "$choice"==2 ]
then
linuxmintrepos
fi
if [ "$choice"==3 ]
then
asusn13driver
fi
if [ "$choice"==4 ]
then
standardopenbox
fi
if [ "$choice"==5 ]
then
xfceopenbox
fi
if [ "$choice"==6 ]
then
backupstandopenbox
fi
if [ "$choice"==7 ]
then
backupxfc4openbox
fi
echo "You installed: "
if [ "$choice"==1 ]
then
echo "baseinstall"
fi
if [ "$choice"==2 ]
then
echo "linuxmintrepos"
fi
if [ "$choice"==3 ]
then
echo asusn13driver
fi
if [ "$choice"==4 ]
then
echo "standardopenbox"
fi
if [ "$choice"==5 ]
then
echo "xfceopenbox"
fi
if [ "$choice"==6 ]
then
echo "backupstandopenbox"
fi
if [ "$choice"==7 ]
then
echo "backupxfc4openbox"
echo "If you would like to keep going, type in 1, if not, type in any other number"
read n
fi
done
case
statements. – HalosGhost Nov 20 '14 at 12:45select
is a better fit here. – mikeserv Nov 21 '14 at 00:11