我知道这很简单,但我无法找到根源。我遇到了一个错误,我无法在这个简单的一个班轮中破译它的根本原因。我正在使用带有草莓 Perl 5.18.2.1-32bit 的 Window 7。
程序 1:仅对非空行进行编号
perl -pe '$_ = ++$a." $_ " if / ./' config01.log
输出:
Can't find string terminator "'" anywhere before EOF at -e line 1.
程序 2:仅对所有行进行编号
perl -ne 'print "$. $_"' config01.log
输出:
Can't find string terminator "'" anywhere before EOF at -e line 1.
使用的样本日志:
cat config01.log
processx>#process processx
processx>
processx>
*** ERROR from SQL [-9204]: Unable to access volume \XTAB.$VOL08.
*** ERROR from File System [66]: device downed, LIU not yet downloaded, or hard
*** failure occurred on controller, or disk and controller incompatible
*** (dp1/dp2)
processx>==== Previous tests used GOOG as sub volume for MX Reportwriter Tests ====
processx>cleanup !$*.GOOG.*,catalogs;
SQL Table \XTAB.$VOL03.GOOG.EMP catalog entry has been removed.
SQL Table \XTAB.$VOL03.GOOG.EMP file label has been purged.
SQL Table \XTAB.$VOL03.GOOG.TAB3 catalog entry has been removed.