GNU bug report logs - #75806
Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty

Previous Next

Package: grep;

Reported by: Andreas BROCKMANN <andreas.brockmann <at> diehl.com>

Date: Fri, 24 Jan 2025 14:50:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas BROCKMANN <andreas.brockmann <at> diehl.com>
Cc: "cygwin <at> cygwin.com" <cygwin <at> cygwin.com>, 75806-done <at> debbugs.gnu.org
Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]"
 faulty
Date: Sat, 25 Jan 2025 11:31:06 -0800
On 2025-01-24 05:27, Andreas BROCKMANN via Bug reports for GNU grep wrote:
> The 1st command below correctly reports trailing spaces, for Unix and Windows format files.
> The 2nd one incorrectly reports all lines.
> 
>    grep -sHn -i " [[:cntrl:]]*$" *.vhd
>    grep -sHn -i "\s[[:cntrl:]]*$" *.vhd

I don't see a bug. The latter command is equivalent to:

   grep -Hins '[[:space:]][[:cntrl:]]*$' *.vhd

and if the input files use Microsoft CRLF format then [[:space:]] 
matches the CR at the end of every line and [[:cntrl:]]* matches the 
empty string after the CR.

Possibly you need to use Unix LF format, or use the --text option, or 
something like that.

Marking the bug as done.




This bug report was last modified 171 days ago.

Previous Next


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