Perl one-line scripting: Some problems
I'm trying to highlight some key words as tailing a log file using a perl script;
about my case:
below is how I use perl search and replace : Code:
s/(?:(unable|exception|warning))/\e[1;31$&....... Thanks in Advance.. |
Hi,
I am not familiar with perl, so not sure if this might help. However, does the 's' command support the 'g' flag? Did you try to set it at the end like Code:
s/.../.../g |
For the second part you might want to go away from a one-liner, add another line that checks for the keyword and increments a counter if it's there and then calls a function when you hit 4 (or whatever), probably want to clear the counter after calling the function. Just put this check before your substituion.
|
All times are GMT -5. The time now is 08:11 PM. |