#!/usr/bin/perl -s $usage = " -f full format (includes file name) -h displays this help and exits use ^ only in the first expression "; if ($h) {print $usage;exit} $a = shift || die("must provide at least one expression\n"); while ($s = shift) {$p .= "| grep $s"} $r = `grep $a *.dat $p`; unless ($f) {$r =~ s/(\n|^).*:/$1/g} print $r