Hi.
A perl script:
Code:
#!/usr/bin/perl
# @(#) p1 Demonstrate search for escape.
use warnings;
use strict;
my($lines) = 0;
while ( <> ) {
$lines++;
print "$. $_" if /\e/xms; # always use xms on matches
}
print STDERR " ( Lines read: $lines )\n";
exit(0);
Run on the data file data1, showing special characters:
Code:
% cat -vet data1
Now is the time to see an escape :^[:$
for all good men$
to come to the aid for escape ^[ from jail$
of their country.$
Produces:
Code:
% ./p1 data1
1 Now is the time to see an escape :
3 to come to the aid for escape from jail
( Lines read: 4 )
with the line number to help locate the lines ... cheers, drl
|