嗨,我试图安装一个相当漫长的脚本安装的InfiniBand和OFED堆栈上的岩石集群6.0/etc/init.d/openibd:行147:附近意外的标记'语法错误;&”
这里是我尝试运行
[email protected] # /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
您不能在降价的引用代码中使用突出显示。我会为你解决它。顺便说一句,你发布的脚本不缩进;原始代码是否正确缩进? –