gpt4 book ai didi

linux - Linux : "loadUI-cmd.sh: ...syntax error near unexpected token ` in"执行loadui测试出错

转载 作者:太空宇宙 更新时间:2023-11-04 11:09:41 25 4
gpt4 key购买 nike

这是我在 linux 中的 shell 命令行:

.../loadUI-cmd.sh -J-Djava.awt.headless=true -p /.../loadui_basicPTproject.xml -r /.../PT_reports -F PDF

这是输出(错误):

: command not found/SmartBear/LoadUI-2.6.8/loadUI-cmd.sh: line 10:
: command not found/SmartBear/LoadUI-2.6.8/loadUI-cmd.sh: line 12:
: command not found/SmartBear/LoadUI-2.6.8/loadUI-cmd.sh: line 14:
'home/bbiixli/tools/SmartBear/LoadUI-2.6.8/loadUI-cmd.sh: line 15: syntax error near unexpected token `in
'home/bbiixli/tools/SmartBear/LoadUI-2.6.8/loadUI-cmd.sh: line 15: `case "`uname`" in

注意:loadUI-cmd.sh 脚本是“产品自带的”。脚本内容如下(前两行是我添加的,以避免运行脚本出现 unix 格式错误。

### the below line was added for linux env 052114
:set fileformat=unix
###!/bin/sh
### ====================================================================== ###
## ##
## loadUI Agent Bootstrap Script ##
## ##
### ====================================================================== ###
### $Id$ ###

DIRNAME=`dirname $0`

# OS specific support (must be 'true' or 'false').
cygwin=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;
esac

# Setup LOADUI_HOME
if [ "x$LOADUI_HOME" = "x" ]
then
# get the full path (without any relative bits)
LOADUI_HOME=`cd $DIRNAME/; pwd`
fi
export LOADUI_HOME

LOADUI_CLASSPATH="$LOADUI_HOME:$LOADUI_HOME/lib/*"

# For Cygwin, switch paths to Windows format before running java
if $cygwin
then
LOADUI_HOME=`cygpath --path -w "$LOADUI_HOME"`
LOADUI_CLASSPATH=`cygpath --path -w "$LOADUI_CLASSPATH"`
fi

JAVA="jre/bin/java"

if [ ! -f "$JAVA" ]; then
JAVA="java"
fi

JAVA_OPTS="-Xms128m -Xmx768m -XX:MaxPermSize=128m"

$JAVA $JAVA_OPTS -cp "$LOADUI_CLASSPATH" com.javafx.main.Main --cmd=true --nofx=true -nofx - Dlog4j.configuration=log4j_headless.xml "$@"

谁能帮我解决这个问题?

谢谢,拉里

最佳答案

您的文件似乎有 DOS 风格的行结束字符。如果您的系统有,请使用 dos2unix 命令修复该问题。如果你没有,你可以这样做:

tr -d '\r' < script.sh > fixed.sh
mv fixed.sh script.sh
chmod +x script.sh

在此之后,将第一行更改为:

#!/bin/sh

那么它应该可以工作了。

关于linux - Linux : "loadUI-cmd.sh: ...syntax error near unexpected token ` in"执行loadui测试出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23793519/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com