in reply to grep with color module of perl

Here is a script that employs use Term::ANSIcolor qw{ :constants }; to highlight parts of a command output in different colours. Perhaps it will help you move forward.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: grep with color module of perl
by vincentaxhe (Scribe) on Aug 05, 2024 at 12:07 UTC
    yeah, test good, that's what I want, It's much concise, what I write before is so inane.
    use Term::ANSIColor qw{ :constants }; while(<>){ s/(hello)/RED . $1 . RESET/eg; print }