写的一段小代码不知道错在哪了

写的一段小代码不知道错在哪了

#!/bin/sh
user()
{
echo "please choice order"
echo "1=ping"
echo "2=rm"
S1=ping
S2=rm
S3=*
read MS
read CS
case $MS in
P1) $S1 $CS
P2) $S2 $CS
*)  echo "WHAT IS IT ?"
esac
}
echo "#############################"
echo "#    A: USERTOOL            #"
echo "#    B: ROOTTOOL            #"
echo "#############################"
echo "please choice A OR B
read AU
if [ $AU = "A" ]
then
user
elif [ $AU = "B" ]
then
echo "hahahaha"
elif [ $AU = * ]
then
echo "What it is??????"
fi
exit 0

请高手只点一下,错在什么地方,应该怎么修改?谢谢了      
改成下面这样,就差不多

#!/bin/sh
user()
{
echo "please choice order"
echo "1=ping"
echo "2=rm"
S1=ping
S2=rm
S3=*
read MS
read CS

case $MS in
P1) eval " $S1 $CS "
    ;;
P2) eval " $S2 $CS "
    ;;
*) echo "WHAT IS IT ?"
   ;;
esac

}
echo "#############################"
echo "# A: USERTOOL #"
echo "# B: ROOTTOOL #"
echo "#############################"
echo "please choice A OR B "
read AU
if [ "$AU" = "A" ]
then
user
elif [ "$AU" = "B" ]
then
echo "hahahaha"
elif [ "$AU" = "*" ]
then
echo "What it is??????"
fi
exit 0