我的脚本如下,
echo "secvise"
echo "1)ls"
echo "2)ls -l"
echo "3)Exit"
echo "choice[1-3]"
read choice
case $choice is
1) ls;;
2) ls -l;;
3) exit;;
*) echo "wrong";;
esac
执行后,出现./diahufuwu.sh: line 8: syntax error near unexpected token `ia'
./diahufuwu.sh: line 8: `case $choice ia'
好像“is”出错了,不知如何改,望各位前辈指点


yuer520 于 2011-07-07 23:27:12发表:
努力
yuer520 于 2011-07-07 23:26:53发表:
这样都能错?
2008chenwanxi 于 2009-05-18 10:16:24发表:
2# dingjing
谢谢,望成为好友,时刻得以领教
dingjing 于 2009-05-17 15:10:57发表:
case $choice is
1) ls;;
2) ls -l;;
3) exit;;
*) echo "wrong";;
esac
不是is,是用in,改为:
case $choice in
1) ls;;
2) ls -l;;
3) exit;;
*) echo "wrong";;
esac