当前位置: 技术问答>linux和unix
求指点:syntax error near unexpected token “fi”的解决办法~~~
来源: 互联网 发布时间:2017-02-28
本文导语: ch="1" while [ $ch != "0" ] do echo "********************" echo "0.Exit" echo "1.Mount USB" echo "2.Umount USB" echo "********************" echo "Please choose number 1,2 or 0:" read ch echo " " if [ $ch = "1" ] Then echo "Please insert your USB" echo "A...
ch="1"
while [ $ch != "0" ]
do
echo "********************"
echo "0.Exit"
echo "1.Mount USB"
echo "2.Umount USB"
echo "********************"
echo "Please choose number 1,2 or 0:"
read ch
echo " "
if [ $ch = "1" ]
Then
echo "Please insert your USB"
echo "Are you ready?(y/n)"
read ready
if [ $ready = "y" ]
Then
mount /dev/sdb1 /mnt/usb
echo "Your usb are mounted"
fi
elif [ $ch = "2" ]
Then
umount /mnt/usb
echo "Please take your usb"
elif [ $ch = "0" ]
Then
echo "Exit now!"
else
echo "Wrong choice!"
echo "Please choose again!"
fi
echo " "
done
这个脚本运行的时候,会提示第21行(也就是第一次出现fi的地方)有错误啊,如题。求解救!!!在线等~~~
while [ $ch != "0" ]
do
echo "********************"
echo "0.Exit"
echo "1.Mount USB"
echo "2.Umount USB"
echo "********************"
echo "Please choose number 1,2 or 0:"
read ch
echo " "
if [ $ch = "1" ]
Then
echo "Please insert your USB"
echo "Are you ready?(y/n)"
read ready
if [ $ready = "y" ]
Then
mount /dev/sdb1 /mnt/usb
echo "Your usb are mounted"
fi
elif [ $ch = "2" ]
Then
umount /mnt/usb
echo "Please take your usb"
elif [ $ch = "0" ]
Then
echo "Exit now!"
else
echo "Wrong choice!"
echo "Please choose again!"
fi
echo " "
done
这个脚本运行的时候,会提示第21行(也就是第一次出现fi的地方)有错误啊,如题。求解救!!!在线等~~~
|
小写then啊,大哥。