0

こんにちは私はロッククラスター6.0にinfinibandとOFEDスタックをインストールするためにかなり長いスクリプトをインストールしようとしています

これが私が実行しようとしているものです

 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
4

2 に答える 2

2

修正が必要なHTMLエンコーディングが進行中です。

に置き換え>、を>に置き換えます。&&

于 2012-05-16T18:52:17.733 に答える
0

あなたのスクリプトはどういうわけかそのすべてを>に置き換えました>(そして&に置き換えられました&、など)

if ( grep -i 'SuSE Linux' /etc/issue >/dev/null 2>&1 ); then

                                                       ^^

前のコマンドを終了するセミコロンとアンパサンドの間にコマンドがないため、これは構文エラーです。結果として、特定のシンボルのHTMLエンコーディングはbashパーサーを混乱させます。

于 2012-05-16T18:52:17.750 に答える