RT
例如:
#!/bin/bash
if [ $1 -gt 90 ]
then
echo "Good, $1"
elif [ $1 -gt 70 ]
then
echo "OK, $1"
else
echo "Bad, $1" 
fi出现错误:line 5:syntax error near unexpected token 'elif'再例如:
#!/bin/bash 
x=1999 
let "x = $x + 1" 
echo $x 
x="olympic'"$x 
echo $x
输出:
") intax error : invalid arithmetic operatior < error token is "
1999
olympic'1999

解决方案 »

  1.   

    莫非java和linux关系真的就这么密切么。。
      

  2.   

    奇怪了,我机器里的cygwin运行你这两个
    程序都没问题:$ ./test.sh 100
    Good, 100
    $ ./test.sh 5
    Bad,5
    $ ./test.sh 80
    Ok, 80$./test2.sh
    2000
    olympic'2000$ bash --version
    GNU bash, version 3.2.49(22)-release (i686-pc-cygwin)
    Copyright (C) 2007 Free Software Foundation, Inc.$ cat /proc/version
    CYGWIN_NT-6.1-WOW64 1.5.25(0.156/4/2) 2008-11-18 15:24
      

  3.   

    是跟Unix密切
    CygWin默认的包shell命令不全的