2

上次提交问题时我很幸运,所以这里是:当我收到以下错误时,我正在尝试调试一个有点大的 BASH 脚本:

./test.sh: line 418: unexpected EOF while looking for matching `"'
./test.sh: line 427: syntax error: unexpected end of file

下面的代码从第 400 行开始:

    echo "###########################################################"
    echo
;;
4)
    culebra_carriers
    get_month
    get_day
    logs_cdrs
    logs_wap
    get_mdn

    echo
    echo "###########################################################"
    echo
    echo "Searching for activity of $mobileNumber on $MON $DAY......."
    echo
    zgrep $mobileNumber $HOME/culebrapeak/$LOGCDR/$CULEB/$MON/$WAPLOG
    echo
    echo "###########################################################"
    echo
;;
esac
done
}

clear
main_menu

如何让这个错误消失?看起来我在所有正确的地方都有双引号......但这只是我的第 4 个或第 5 个 bash 脚本......所以请放轻松。

4

2 回答 2

2

A good way to solve problems like this is to use a text editor that highlights code between quotes. Short of that, if the "find" feature of your text editor gives a count too, you may be able to use it to quantitatively detect start/end character symmetry problems. The highlighting from the find feature will aide your eye tremedously.

于 2014-05-14T22:35:54.250 回答
2

确实,我在脚本顶部缺少双引号。感谢大家的帮助!

于 2012-06-15T22:15:42.953 回答