Shell Play framework,为什么安装脚本会给出python语法错误?

Shell Play framework,为什么安装脚本会给出python语法错误?,shell,playframework,syntax-error,Shell,Playframework,Syntax Error,我正试图按照说明安装play框架 但是,我没有成功地执行安装文件中的播放脚本 到目前为止我所做的: 安装了OpenJava,所以现在java版本和jaac版本都可以工作了 Didchmoda+x./play为了赋予脚本权限,我甚至对整个目录进行了chmoda+xplay-2.0.4 在没有成功之后,我发现play脚本可以用以下命令执行:python./play 但是我得到了这个错误: File "./play", line 4 while [ -h "$PRG" ] ; do

我正试图按照说明安装play框架 但是,我没有成功地执行安装文件中的播放脚本

到目前为止我所做的:

  • 安装了OpenJava,所以现在java版本和jaac版本都可以工作了
  • Did
    chmoda+x./play
    为了赋予脚本权限,我甚至对整个目录进行了
    chmoda+xplay-2.0.4
  • 在没有成功之后,我发现play脚本可以用以下命令执行:python./play
  • 但是我得到了这个错误:

      File "./play", line 4
        while [ -h "$PRG" ] ; do
                        ^
    SyntaxError: invalid syntax
    
    所以我的问题是: 为什么会出现这种语法错误,脚本不可能有语法错误

    仅供参考,以下是整个脚本:

    done
    dir=`dirname $PRG`
    
    if [ -f conf/application.conf ]; then
      if test "$1" = "clean-all"; then
        rm -rf target
        rm -rf tmp
        rm -rf logs
        rm -rf dist
        rm -rf project/project
        rm -rf project/target
        if [ $# -ne 1 ]
        then  
         shift
        else
          echo "[info] Done!"
          exit 0
        fi
      fi
      if test "$1" = "stop"; then
        if [ -f RUNNING_PID ]; then
          echo "[info] Stopping application (with PID `cat RUNNING_PID`)..."
          kill `cat RUNNING_PID`
    
          RESULT=$?
    
          if test "$RESULT" = 0; then
            echo "[info] Done!"
            exit 0
          else
            echo "[\033[31merror\033[0m] Failed ($RESULT)"
            exit $RESULT
          fi
        else
          echo "[\033[31merror\033[0m] No RUNNING_PID file. Is this application running?"
          exit 1
        fi
      fi
    
      if test "$1" = "debug"; then
        JPDA_PORT="9999"
        shift      
      fi
    
      if [ -n "$1" ]; then
        JPDA_PORT="${JPDA_PORT}" $dir/framework/build "$@"
      else
        JPDA_PORT="${JPDA_PORT}" $dir/framework/build play
      fi
    
    else
      java -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
    fi
    

    提前谢谢你

    您正试图使用Python运行shell脚本,这是行不通的


    尽管Play版本1使用了Python,但版本2已改为使用shell脚本。

    Python从何而来?这不是python脚本。你好,matijin。。抱歉,如果我犯了一些大错误,我在linux上只呆了几天。至于python,我读到这个脚本是一个python脚本,所以我想我可以用python运行它。/play(但我可能错了)这看起来像一个shell脚本;您链接到的说明根本没有提到python。它不能与python一起工作这一事实并不奇怪。谢谢Martjin,很高兴知道它不是python脚本,它帮助我关注其他地方。一天多之后,我找到了一些解决方案,可以让任何感兴趣的人玩这个游戏:我必须将文件夹移动到/home。这允许我对文件夹授予权限(右键单击->权限->组[我的名字],访问:读和写)。然后我在文件夹范围内执行了./play。然而,官方推荐的不是玩。