"Siegfried Heintze" <[EMAIL PROTECTED]> writes:
> This, works, but it sure is ugly. Is there not an easier way to do this with
> perl?
>
> perl -e'@ARGV = ("-") unless @ARGV; while(@ARGV){ $ARGV= shift @ARGV;
> if(!open(ARGV, $ARGV)){ warn "Cannot open $ARGV: $!\n"; next;} while
> (<ARGV>){ print "$ARGV:$.:$_\n" if/^ *END *$/; }}' *.f
Doesn't something simple like:
perl -n -e 'print "$ARGV\n$. $_" if /PATTERN/' *.f
work for you.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>