bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion for a new option


From: Matthew Wakeling
Subject: Suggestion for a new option
Date: Thu, 13 Nov 2008 09:44:36 -0700 (MST)
User-agent: Alpine 1.10 (DEB 962 2008-03-14)

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!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]