ºìÁªLinuxÃÅ»§
Linux°ïÖú

shell½Å±¾case.....esac

·¢²¼Ê±¼ä:2009-05-17 06:36:50À´Ô´:ºìÁª×÷Õß:2008chenwanxi
ÎҵĽű¾ÈçÏ£¬
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¡±³ö´íÁË£¬²»ÖªÈçºÎ¸Ä£¬Íû¸÷λǰ±²Ö¸µã
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 4 ÌõÆÀÂÛ

  1. yuer520 ÓÚ 2011-07-07 23:27:12·¢±í:

    ŬÁ¦

  2. yuer520 ÓÚ 2011-07-07 23:26:53·¢±í:

    ÕâÑù¶¼ÄÜ´í£¿

  3. 2008chenwanxi ÓÚ 2009-05-18 10:16:24·¢±í:

    2# dingjing

    лл£¬Íû³ÉΪºÃÓÑ£¬Ê±¿ÌµÃÒÔÁì½Ì

  4. 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