I found out about ack awhile back -- it's like grep on steroids.
The manual's a little light on the details.
All it says is:
--output=expr
Output the evaluation of expr for each line
What expression are they talking about? A regular expression? If so, how is that different from a normal grep? # Print included files.
ack --output '$1' '#include <(.*)>'
You could presumably do much trickier things as well, since the --output argument can contain any Perl expression.Don't go for ack, which is some Kanji character converter.