0
mysqldump -u $dbUsername --password=$dbPassword --databases $db | gzip > ${dbBackup}/${db}-${date}.sql.gz
if [ echo $? -ne 0 ]; then
  mail -s "Backup mysql cron job $0 failed" $MAIL_TO <<EOF


 EOF

执行脚本后出错 - 意外的行尾

4

1 回答 1

1

缺少终止 if 语句的 fi:

mysqldump -u $dbUsername --password=$dbPassword --databases $db | gzip > ${dbBackup}/${db}-${date}.sql.gz
if [ echo $? -ne 0 ]; then
  mail -s "Backup mysql cron job $0 failed" $MAIL_TO <<EOF
 EOF
fi
^^^
于 2013-09-27T06:58:51.993 回答