Skip to content

Instantly share code, notes, and snippets.

@davidgfolch
davidgfolch / colorTail.pl
Created October 30, 2024 14:10
Perl script to (re)colorize console outputs
#!/usr/bin/perl -w
print "\e[1;32m==================================================================================================\n";
print "\e[1;33m## colorTail.pl by David G. Folch ##\n";
print "\e[1;32mColorTail gives color to your console outputs.\n";
print "Optionally accepts a regex parameter, this regex (not casesensitive) will be colored in green\n";
print "Example: tail /var/logs/*.log | perl colorTail.pl\n";
print "Example: tail /var/logs/*.log | perl colorTail.pl myCustomGreenColoredMatchRegexText\n";
print "==================================================================================================\e[0m\n";
$markedText=$ARGV[0];