0

I know this is simple, but I am unable to get to the the root. I am getting an error and i am not able to decipher the root cause of it in this simple one liner. I am using Window 7 with Strawberry Perl 5.18.2.1-32bit.

Program 1: For numbering only the non-empty line

perl -pe '$_ = ++$a." $_ " if / ./' config01.log

Output:

Can't find string terminator "'" anywhere before EOF at -e line 1.

Program 2:For numbering only the all line

perl -ne 'print "$. $_"' config01.log

Output:

Can't find string terminator "'" anywhere before EOF at -e line 1.

Sample Log used:

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.
May
  • 1,158
  • 2
  • 13
  • 24
  • 1
    I think your shell is interpreting something here. If you're on Windows, try switching the `'`s around the oneliner to `"`s and change the ""s in the script to generic quotes (`qq()`). – Slade Jul 16 '14 at 05:08
  • Thanks, now it works. The interpolation of ' and " in windows seems to be a problem. – May Jul 16 '14 at 05:16

0 Answers0