--- Begin Message ---
Subject: |
grep documentation feedback |
Date: |
Thu, 10 Jun 2021 20:42:03 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
I hope that you are well.
Thank you for your work on this great software.
I have some feedback about the document at the following address:
http://www.gnu.org/software/grep/manual/grep.html
When quoting from this document, I have removed the non-ASCII
characters. The characters that I have removed were left and right
single quotation marks.
1. In the section "3.3 The Backslash Character and Special Expressions":
\<
Match the empty string at the beginning of word.
\>
Match the empty string at the end of word.
Perhaps changing "of word" to "of a word" would be more consistent with
the language elsewhere in the document.
2. In the section "3.6 Basic vs Extended Regular Expressions":
In basic regular expressions the meta-characters ?, +, {, |, (, and )
lose their special meaning; instead use the backslashed versions \?, \+,
\{, \|, \(, and \).
Should } and \} appear in these lists?
3. In the section "4 Usage":
$ grep -n -- 'f.*\.c$' *g*.h /dev/null
The other examples do not begin with $. Perhaps remove $ for greater
consistency.
4. In the section "4 Usage", perhaps the answer to question 3 would be
better if the examples used -* in place of * to search for files that
begin with -.
Thank you.
David
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#48948: grep documentation feedback |
Date: |
Thu, 10 Jun 2021 16:10:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 6/10/21 12:42 PM, David Apps via Bug reports for GNU grep wrote:
Perhaps changing "of word" to "of a word"
Good idea, thanks.
In basic regular expressions the meta-characters ?, +, {, |, (, and )
lose their special meaning; instead use the backslashed versions \?, \+,
\{, \|, \(, and \).
Should } and \} appear in these lists?
No, as '}' is not a meta-character in EREs. The '}' case is different
and this is discussed in the next sentence.
3. In the section "4 Usage":
$ grep -n -- 'f.*\.c$' *g*.h /dev/null
The other examples do not begin with $. Perhaps remove $ for greater
consistency.
That's easy enough. Also, I noticed that the surrounding explanation is
a bit wrong, so I fixed that too.
4. In the section "4 Usage", perhaps the answer to question 3 would be
better if the examples used -* in place of * to search for files that
begin with -.
The problem almost always occurs with patterns that begin with "*" and
unexpectedly match file names beginning with "-", so in some sense it's
better to leave this example as-is so that it's more-typical.
I installed the attached patch to implement the above. Thanks for your
feedback.
0001-doc-improve-examples-and-wording.patch
Description: Text Data
--- End Message ---