这是我在linux中的shell命令行:
.../loadUI-cmd.sh -J-Djava.awt.headless=true -p /.../loadui_basicPTproject.xml -r /.../PT_reports -F PDF这是输出(error):
: 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 "$@"有人能帮我解决这个问题吗?
谢谢,拉里
发布于 2014-05-22 22:18:32
您的文件似乎有DOS样式的行结束字符。如果您的系统中有dos2unix命令,请使用该命令进行修复。如果你没有它,你可以这样做:
tr -d '\r' < script.sh > fixed.sh
mv fixed.sh script.sh
chmod +x script.sh在此之后,将第一行更改为:
#!/bin/sh那么它应该是有效的。
https://stackoverflow.com/questions/23793519
复制相似问题