There is more than one error in your script, like nested quotes, an extra "read A", and the ' [ ' and ' ] ' around the names of shell-scripts you want to execute. While there's nothing wrong with the exit-option in your menu.
I guess you copied it incorrectly to the forum-entry-box (?).
Anyways, I fixed it:
Code:
#!/bin/bash
echo -n "Your current IPaddress is: "
/sbin/ifconfig eth0 | grep inet|cut -d : -f 2|cut -d " " -f 1
echo
uptime
echo
echo "What do you want to do today?"
echo "1.Burn a cd"
echo "2.Erease a CD"
echo "3.Use instant messenger"
echo "4.Exit"
read A
if [ $A -eq 1 ]
then
cdwrite.sh
fi
if [ $A -eq 2 ]
then
cde.sh
exit
fi
if [ $A -eq 3 ]
then
amsn
exit
fi
if [ $A -eq 4 ]
then
exit
fi
Or better maybe:
Code:
#!/bin/bash
clear
echo -n "Your current IPaddress is: "
/sbin/ifconfig eth0 | grep inet|cut -d : -f 2|cut -d " " -f 1
echo
uptime
while true ; do
echo
echo "What do you want to do today?"
echo "1.Burn a cd"
echo "2.Erease a CD"
echo "3.Use instant messenger"
echo "4.Exit"
read A
case "$A" in
"1") cdwrite.sh;;
"2") cde.sh;;
"3") amsn;;
"4") exit 0;;
*) echo -e "\n==> Sorry, menu option not recognized.";;
esac
done
# We should never get here...
exit 1