#!/usr/local/bin/perl -w ###################################################################### # tgrep -- 2005, Mike Schilli ###################################################################### use strict; use Pod::Usage; my $VERSION = "0.01"; my $pattern = shift; pod2usage("No pattern given") unless defined $pattern; for(@ARGV) { next unless -T $_; next if -s $_ > 100_000; next if -d $_; system "grep '$pattern' $_ /dev/null"; } __END__ =head1 NAME tgrep - Grep, but only in Text files =head1 DOWNLOAD _SRC_HERE_ =head1 SYNOPSIS tgrep pattern file ... =head1 DESCRIPTION tgrep works like grep (and if fact uses it internally), it just skips entries that aren't text files or files that exceed 100K in size. =head1 EXAMPLES $ tgrep home /etc/* =head1 LEGALESE Copyright 2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR 2005, Mike Schilli