Jerry Rocteur wrote: > > Hi, Hello,
> I'm trying to use perl for most shell stuff and this is some of the > stuff I'm using for grep .. > > perl -ne 'print "$ARGV: $_" if /jerry/i ' * > perl -ne 'print if /jer{1,}y/i ' * > perl -ne 'print unless /jer{1,}y/i ' * > > I'm enjoying this as I can do a lot more than I can with the old egrep > on our Solaris boxes.. > > What I'd like to do is to make a simple change NOT to check in binary > files and directories.. > > I've toyed with all sorts of variations and started like this. > > perl -ne '-f &&print if /satreq/ ' * # Don't laugh this is one of very > many attempts ;-(( > > Then I tried this: > > perl -ne 'if(/rcn/) {print "$ARGV: $_" unless -d}' * > > Which seems to do the trick but this is just excluding directories I > think.. > > But this gives me the same: > > perl -ne 'if(/.it/) {print "$ARGV: $_" unless -f}' * > > How do I improve it to ONLY look in text files ? > > I don't want to use the grep.pl's around or the grep from power tools, > I want to impress the ladies by typing these on the CLI ;-)) Seriously, > I love one liners.. Something like this might work (untested): perl -ne' close ARGV unless -f ARGV && -T _; print if /jer+y/i ' * John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]