I have a suggestion for a new option for grep, which is really rather
obvious and simple to implement, and comes about by me running commands
like:
ps auxww | grep something
I would like an option that would make grep output the first line (or two
- an extended option maybe) regardless of whether that line matches. That
way, I would get the titles at the top of my report, which would be
useful.
What exactly grep should do when searching several files with this option
switched on is up for debate. My guess is the best method would be to
output the first line(s) of each file that have a matching line, although
that may not be the easiest to implement. This option would also interact
with the -A and -C options.
Is there anyone with a burning desire to implement this, or shall I have a
go? Any strong opinions on whether the option would be accepted into main
grep, or what the option name/letter should be?
Matthew
--
Illiteracy - I don't know the meaning of the word!