アプリ版:「スタンプのみでお礼する」機能のリリースについて

RedHat9上で作成しているスクリプトに関しての質問です。

#!/bin/bash -x
/bin/date

MAIL=user33
SCRPT_NAME=sshPortFoward.cron
HOST=foo.hoge.com
UNAME=user01
PASSWD=xxxxxxxx
SRC_FWD_PORT=60143
DST_FWD_PORT=143
SSH_PORT=60001
SSH_PORT_FWD_KEKKA=`/bin/ps ax | /bin/grep $HOST | /bin/grep $SRC_FWD_PORT | /bin/grep $DST_FWD_PORT | /bin/grep $UNAME`

if [ -z "$SSH_PORT_FWD_KEKKA" ]; then
( /bin/date ; /bin/ps ax | /bin/grep $HOST | /bin/grep $SRC_FWD_PORT | /bin/grep $DST_FWD_PORT | /bin/grep $UNAME) | \
/bin/mail -s $SCRPT_NAME":could ssh port forward $MAIL
fi

というスクリプトで
「if [ -z "$SSH_PORT_FWD_KEKKA" ]; then」で引っかかっているみたいです。

++ /bin/ps ax
++ /bin/grep foo.hoge.com
++ /bin/grep 60143
++ /bin/grep 143
++ /bin/grep user01
+ SSH_PORT_FWD_KEKKA=
/etc/cron/ip_adr_change.cron/sshPortFoward.cron: line 17: unexpected EOF while looking for matching `"'
/etc/cron/ip_adr_change.cron/sshPortFoward.cron: line 19: syntax error: unexpected end of file

とエラーになってしまいます。
「予想外のEOF!?」という意味ですかね。
文字列にスペースがあるので「""」で括っているのですが、、、

どういう風に訂正したらいいんでしょうか?

A 回答 (1件)

hhozumiさんが書かれたスクリプト中で、


/bin/mail -s $SCRPT_NAME":could ssh port forward $MAIL
の行中の$SCRPT_NAMEの始めの「"」がありません。写し間違えでなければですが...
    • good
    • 1
この回答へのお礼

有難うございます。

「/bin/mail -s $SCRPT_NAME":could ssh port forward 「$MAIL」

で解決できました。どうもお騒がせ致しました。

お礼日時:2005/01/24 18:45

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!

このQ&Aを見た人はこんなQ&Aも見ています


このQ&Aを見た人がよく見るQ&A