Hello, brothers!
Strange that noone posted this yet, because it seems to be rather useful CUFP. Simple as it sounds: tail -f combined with grep, even with grep -E.
#!/usr/local/bin/perl -w use strict; my $usage = "Usage: gtail <filename> <options for grep>\n"; my $file = shift or die $usage; @ARGV or die $usage; open(TAIL, "tail -f $file|") or die "Can't pipe from tail: $!"; open(GREP, "|grep @ARGV") or die "Can't pipe to grep: $!"; select((select(GREP), $|=1)[0]); while(<TAIL>) { print GREP $_; }
In reply to grep'ed tail by maard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |