GNU bug report logs - #68776
bug with escape characters in pattern

Previous Next

Package: grep;

Reported by: Brendan Richardson <brichardson <at> brandeis.edu>

Date: Sun, 28 Jan 2024 08:45:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68776 in the body.
You can then email your comments to 68776 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#68776; Package grep. (Sun, 28 Jan 2024 08:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brendan Richardson <brichardson <at> brandeis.edu>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Sun, 28 Jan 2024 08:45:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brendan Richardson <brichardson <at> brandeis.edu>
To: bug-grep <at> gnu.org
Subject: bug with escape characters in pattern
Date: Sat, 27 Jan 2024 19:00:37 -0500
[Message part 1 (text/plain, inline)]
Hello,

If you use input
egrep "[^\\n\\t]" file

and the file contains a line with only n or t on it, those lines are also
excluded
file
normal lines
tttttt
nnnnn



KR
Brendan Richardson
[Message part 2 (text/html, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 29 Jan 2024 02:36:02 GMT) Full text and rfc822 format available.

Notification sent to Brendan Richardson <brichardson <at> brandeis.edu>:
bug acknowledged by developer. (Mon, 29 Jan 2024 02:36:02 GMT) Full text and rfc822 format available.

Message #10 received at 68776-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Brendan Richardson <brichardson <at> brandeis.edu>
Cc: 68776-done <at> debbugs.gnu.org
Subject: Re: bug#68776: bug with escape characters in pattern
Date: Sun, 28 Jan 2024 18:35:35 -0800
On 2024-01-27 16:00, Brendan Richardson wrote:
> If you use input
> egrep "[^\\n\\t]" file
> 
> and the file contains a line with only n or t on it, those lines are also

This is the correct behavior. The command you mention is equivalent to

grep -E '[^nt\]' file

and this outputs all lines containing some character other than 'n', 
't', or '\'. A line containing only n or t should not be output.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 26 Feb 2024 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.