您好,我正在尝试安装一个相当长的脚本来安装infiniband和OFED堆栈上的岩石集群6.0
下面是我尝试运行的内容
user@cluster # /etc/init.d/openibd restart
/etc/init.d/openibd: line 147: syntax error near unexpected token `;&'
/etc/init.d/openibd: line 147: `if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then'有没有人可以跟我分享一个修复方法,或者可以找出修复这个脚本错误的方法?在文件/etc/init.d/openibd中
这是脚本的一部分,其中包含指示行上的错误。
CONFIG="/etc/infiniband/openib.conf"
if [ ! -f $CONFIG ]; then
echo No InfiniBand configuration found
exit 0
fi
. $CONFIG
CWD=`pwd`
cd /etc/infiniband
WD=`pwd`
PATH=$PATH:/sbin:/usr/bin
if [ -e /etc/profile.d/ofed.sh ]; then
. /etc/profile.d/ofed.sh
fi
# Only use ONBOOT option if called by a runlevel directory.
# Therefore determine the base, follow a runlevel link name ...
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# ... and compare them
if [ $link == $base ] ; then
RUNMODE=manual
ONBOOT=yes
else
RUNMODE=auto
fi
ACTION=$1
shift
RESTART=0
max_ports_num_in_hca=0
# Check if OpenIB configured to start automatically
if [ "X${ONBOOT}" != "Xyes" ]; then
exit 0
fi
### ERROR ON FOLLOWING LINE ###
if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then
if [ -n "$INIT_VERSION" ] ; then
# MODE=onboot
if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ${CONFIG} > /dev/null
; then
exit 0
fi
fi
fi发布于 2012-05-17 02:52:18
你需要修复他们的一些HTML编码。
将>替换为>,将&替换为&。
发布于 2012-05-17 02:52:18
您的脚本以某种方式将其所有>替换为> (并替换为&,等等)
if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then
^^这是一个语法错误,因为在终止前面命令的分号和与号之间没有命令。因此,某些符号的HTML编码会使bash解析器感到困惑。
https://stackoverflow.com/questions/10624737
复制相似问题