From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 09:49:44 2025 Received: (at submit) by debbugs.gnu.org; 24 Jan 2025 14:49:44 +0000 Received: from localhost ([127.0.0.1]:44348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbL0A-0003gk-Rs for submit@debbugs.gnu.org; Fri, 24 Jan 2025 09:49:44 -0500 Received: from lists.gnu.org ([2001:470:142::17]:57122) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbJig-0008Gb-LM for submit@debbugs.gnu.org; Fri, 24 Jan 2025 08:27:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJiY-0000lX-MP for bug-grep@gnu.org; Fri, 24 Jan 2025 08:27:28 -0500 Received: from enterprise01.smtp.diehl.com ([193.201.238.219]) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJiU-0002Mq-Gm for bug-grep@gnu.org; Fri, 24 Jan 2025 08:27:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=diehl.com; i=@diehl.com; q=dns/txt; s=default; t=1737725241; x=1769261241; h=from:to:cc:subject:date:message-id:mime-version; bh=gtB6xvlKfbqgqGguJgqxwJCFdMghiISP+Uc/YfpmU3E=; b=lcEbJr6z1lujbrH1sYQQFw2D296LBt7mD6iBT6g9u8iZ1/ryoR3hW+Gh fQIWZBLPuqia4rhi6eTiuDL+gasjEABOQZArcKGOfhT7ikyWht/uCaYSq n680kFfW2DnDqtaOj3RDtoET9pfMXNCxhb9einOHFm3kVdW7iv4ltdqHb 3tDy9MiYwc7Kg5h4Dk017nhHMLR7VolFm3caztePnpClTWYH+1M1iOZLL Yu/jy7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ZsssyH1iOvsXIIIv3sfGzSoeYGJP9VTI/Hm/vCH oKWzb+YM1G80CwQ3f9xAPcXnv8E3aPi66Y0JKqiNT75LJ9QrGk6DJl+2hRzvv7XAF/jg== X-Talos-CUID: =?us-ascii?q?9a23=3AQseD5WsPK7ybV27Rw6fZIy+m6IsIL0Lg1lbOeHO?= =?us-ascii?q?UInxFSbPJQHbJ1KBdxp8=3D?= X-Talos-MUID: 9a23:yfNjtgUMjU+jIfnq/BSvqwhMaeVV2L63LWUogbcsqs7eEjMlbg== X-IronPort-AV: E=Sophos;i="6.13,231,1732575600"; d="png'150?scan'150,208,217,150";a="111093938" From: Andreas BROCKMANN To: "bug-grep@gnu.org" Subject: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty Thread-Topic: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty Thread-Index: AdtuYxPnElJhCUJhS/mzvLYqxZnadQ== Date: Fri, 24 Jan 2025 13:27:13 +0000 Message-ID: Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-disclaimerprocessed: True Content-Type: multipart/related; boundary="_006_ad4ae696207443f284d8700791d989eddiehlcom_"; type="multipart/alternative" MIME-Version: 1.0 X-GBS-PROC: /xTc1oHXNDAE8C648WBLodQHFIW0IDQ0nZuIk/rTvAB1vjIwbuWFm4jpumohLUwxqftmM6tfaMhtTlQE5dJkeHWOMooHYS6VF37YV/NEFCA= X-GBS-PROCJOB: GfnEogGANKFqt4oTQdv7NCtMM5VZoRWMthpyt5ofSTRow87dj7y1jAhjz8bEFo3b Received-SPF: pass client-ip=193.201.238.219; envelope-from=prvs=1127b2cfb=andreas.brockmann@diehl.com; helo=enterprise01.smtp.diehl.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 24 Jan 2025 09:49:41 -0500 Cc: "cygwin@cygwin.com" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --_006_ad4ae696207443f284d8700791d989eddiehlcom_ Content-Type: multipart/alternative; boundary="_000_ad4ae696207443f284d8700791d989eddiehlcom_" --_000_ad4ae696207443f284d8700791d989eddiehlcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, The 1st command below correctly reports trailing spaces, for Unix and Windo= ws format files. The 2nd one incorrectly reports all lines. grep -sHn -i " [[:cntrl:]]*$" *.vhd grep -sHn -i "\s[[:cntrl:]]*$" *.vhd grep -V grep (GNU grep) 3.0 Packaged by Cygwin (3.0-2) Copyright (C) 2017 Free Software Foundation, Inc. cmd --help Microsoft Windows [Version 10.0.19045.5371] (c) Microsoft Corporation. All rights reserved. Kind Regards Brockmann Andreas Brockmann, Dipl.-Ing. Hardware Engineer Strategic Business Segment Aircraft Systems HW & Mech. Engineering & Config. Management phone +49 7551 891 4104 andreas.brockmann@diehl.com | www.diehl.com/aviation Diehl Aerospace GmbH Alte Nussdorfer Strasse 23 | 88662 Ueberlingen | Germany Diehl Aerospace is a Joint Diehl Thales Company [cid:image001.png@01DB6E6A.9AA98030] Discover our product highlights! [cid:image002.png@01DB6E6A.9AA98030] = [cid:image003.png@01DB6E6A.9AA98030] Save Paper! Think Before You Print. Diehl Aerospace GmbH, Alte Nu?dorfer Stra?e 23, 88662 Ueberlingen, Deutschl= and/Germany Sitz der Gesellschaft/registered office: Ueberlingen | Registergericht/Regi= stry court: Freiburg, HRB 581408 Geschaeftsfuehrer/General management: Dipl.-Betr.-Wirt (BA) Florian Maier (= Vorsitzender/CEO), Dipl.-Wirtsch.-Ing. Joerg Maeder, Dipl.-Kfm. Eric Gros Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mai= l enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Infor= mieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten hab= en. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form d= er Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation di= eser E-Mail ist strengstens untersagt. Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie = unter: https://www.diehl.com/group/de/transparenz-und-informationspflichten The content of the above mentioned e-mail is not legally binding. This e-ma= il contains confidential and/or legally protected information. Please infor= m us if you have received this e-mail by mistake and delete it in such a ca= se. Each unauthorized reproduction, disclosure, alteration, distribution an= d/or publication of this e-mail is strictly prohibited. For general information on data protection and your respective rights pleas= e visit: https://www.diehl.com/group/en/transparency-and-information-obliga= tions --_000_ad4ae696207443f284d8700791d989eddiehlcom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

The 1st command below correctly reports trailing spa= ces, for Unix and Windows format files.

The 2nd one incorrectly reports all lines.

 

  grep -sHn -i " [[:cntrl:]]*$" *.vhd=

  grep -sHn -i "\s[[:cntrl:]]*$" *.vh= d

 

grep -V

grep (GNU grep) 3.0

Packaged by Cygwin (3.0-2)

Copyright (C) 2017 Free Software Foundation, Inc.

 

cmd --help

Microsoft Windows [Version 10.0.19045.5371]

(c) Microsoft Corporation. All rights reserved.=

 

Kind Rega= rds

Brockmann=

&nbs= p;

Andreas Brockmann, Dipl.-Ing.

Hardware Engineer

Strategic Business Segment Aircraft Syste= ms

HW & Mech. Engineering & Config. = Management

 

phone +49 7551 891 4104

andreas.brockmann@diehl.com | www.diehl.c= om/aviation

 

Diehl Aerospace GmbH
Alte Nussdorfer Strasse 23 | 88662 Ueberlingen | Germany
<= /span>

 

Diehl Aerospace is a Joint Diehl Thales C= ompany

 

 

Discover our product highlights!

 

=     =

 

Save Paper! Think Before You Print.<= /span>

 

Diehl Aerospace GmbH, Alte Nußdorfer Straße 23, 88662 Ueberl= ingen, Deutschland/Germany

Sitz der Gesellschaft/registered office: Ueberlingen | Registergericht/R= egistry court: Freiburg, HRB 581408

Geschaeftsfuehrer/General management: Dipl.-Betr.-Wirt (BA) Florian Maie= r (Vorsitzender/CEO), Dipl.-Wirtsch.-Ing. Joerg Maeder, Dipl.-Kfm. Eric Gro= s

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-= Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. In= formieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten = haben. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form der Reproduktion, Bekanntgabe, Ae= nderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens unte= rsagt.
Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie = unter: https://www.diehl.com/group/de/transparenz-und-informationspflichten<= /a>

The content of the above mentioned e-mail is not legally binding. This e= -mail contains confidential and/or legally protected information. Please in= form us if you have received this e-mail by mistake and delete it in such a= case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is = strictly prohibited.
For general information on data protection and your respective rights pleas= e visit:
https://www.diehl.com/group/en/transparency-and-information-obligations=

 

--_000_ad4ae696207443f284d8700791d989eddiehlcom_-- --_006_ad4ae696207443f284d8700791d989eddiehlcom_ Content-Type: image/png; name="image001.png" Content-Description: image001.png Content-Disposition: inline; filename="image001.png"; size=3241; creation-date="Fri, 24 Jan 2025 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QdyK kOFY1dmS6704nPs7Ue5UPi/he8MbH5DQn0r4muS2vSq88DZRv4e/OE5lR6mLBPv/gL6Jg6zKxz+V LLNdEi+HT6iN0uxUCH0jJzwMFsEhJLMApxLC/wFCoaWuNmpeYgAAAABJRU5ErkJggg== --_006_ad4ae696207443f284d8700791d989eddiehlcom_ Content-Type: image/png; name="image002.png" Content-Description: image002.png Content-Disposition: inline; filename="image002.png"; size=529; creation-date="Fri, 24 Jan 2025 13:27:12 GMT"; modification-date="Fri, 24 Jan 2025 13:27:12 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAAGFodtPAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAABpUExURR2h8vn8/v///zes81u69V679fv9/kWx9HvH9mvB9ial8un1/Vy79UKw823C 9oLL95TS+Nzv/C6o8iCi8oHK92W+9S2n8sLl+x+h8u74/qfa+cHk+vP5/ez3/iKj8mK99Umz9GrB 9QAAAFiWH8QAAAAjdFJOU/////////////////////////////////////////////8AZimDlgAA AAlwSFlzAAAh1QAAIdUBBJy0nQAAAQJJREFUOE/t1UEPgjAMhmFSSCBcjAcP6v//n3btu8FGUWNI vPAchH7tZCHGdRG52aeIVXeub4mOpwuLvllSSwvzE1X6olKt748yLZtVIreqSgaq5vGpeKzuj97Y z/J+bVNDtS12aZ1mwzOhI3RViywjTUhWaNwpF6PlFKeP7G1V7yu/PXuRdU/rmWtiWUZil6Zz8dAR uiuhIwShI8sGYkVSECckC/KgU3pUBbEiWLPc/slOJ2U/COmpQiIjd86XgGyjaVq5IG3pqWr8X7un chaFJiYCTGzRDzESYCDAQIyZlp62++ojqHjS3sNYhdZ7T4bd9pTaYjTLJ+0+Bgvi07913Qv7OgVs sV5KQgAAAABJRU5ErkJggg== --_006_ad4ae696207443f284d8700791d989eddiehlcom_ Content-Type: image/png; name="image003.png" Content-Description: image003.png Content-Disposition: inline; filename="image003.png"; size=651; creation-date="Fri, 24 Jan 2025 13:27:12 GMT"; modification-date="Fri, 24 Jan 2025 13:27:12 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAD0AAAA0CAMAAAF5tPCFAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAACBUExURQAAAAAAAABAnxpmsxddoiJmuyherh1isSJmsx5hsCJisSRksyZlsCRlsCZl ryVksiZksiZnryRmrydnsiZksidnsCZmsiZmsydlsSdmsSdmsCdlryhnsihksSZnsiZmsCdnsShm siZlsSdmsSdlsSdnsSZmsidmsidmsidmsihnsoKRXm4AAAAqdFJOUwABCAoLDxMaHio0QERHSVlm Zml3h4uOk5yqrLC9wczW4eXm6evr8vn8/a8AYLoAAAAJcEhZcwAAIdUAACHVAQSctJ0AAAFdSURB VDhP7ZXpUsMwDITFWW7KfdNyQ97/AZHXaztOFMfpD2YY+NpGWq3WPWbaijRAq+/CwE/EXdFApIbE tBuzAT7oL/pAqNX4nbN4DsC+2wnEAe5o04APc9CiO7AW9LJGFXTasffxguBkGm3QKKvpFj29m+sM Xe7uZyQ/1BzYVb5N8n2F9LwO+lHZflI/6dvI81FpYUP2Swc8whw+fsS+qLXNrWiHmlNrjxxuU237 otflPM5MGyM/NOzAkM3i6oAd6h+wTcZt/SJQ9DlUr2Dj7II/CIMOTqZwzqjCyRT8JwI4aZpPFR/s y/TTX5Qv1CX6aaqqd9JPLyjvqEtY7/tSxSn7Mla6HiPdluyXqc2epDK9w8YDy1GX7gJPqU+f3Gyz E7mCWZ2+hkqasjINoVD+pyOc/OL0BFz6fVPu11dNz/S33t0eOJqAPvWxJvfcv4XI09sEbl1CZKs5 aES+AWS6R/GJ9hefAAAAAElFTkSuQmCC --_006_ad4ae696207443f284d8700791d989eddiehlcom_-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 14:26:18 2025 Received: (at submit) by debbugs.gnu.org; 24 Jan 2025 19:26:18 +0000 Received: from localhost ([127.0.0.1]:47145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbPJq-0003yy-A7 for submit@debbugs.gnu.org; Fri, 24 Jan 2025 14:26:18 -0500 Received: from lists.gnu.org ([2001:470:142::17]:38662) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbPJo-0003yh-CJ for submit@debbugs.gnu.org; Fri, 24 Jan 2025 14:26:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbPJi-0006hI-2e for bug-grep@gnu.org; Fri, 24 Jan 2025 14:26:10 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbPJd-0000pg-0z for bug-grep@gnu.org; Fri, 24 Jan 2025 14:26:09 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C483F240027 for ; Fri, 24 Jan 2025 20:26:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1737746761; bh=J9GoEtlGog3J4YEa09fU9VHFaIZF1qQjGT8PYXZhyk0=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:From; b=im4TnaZVZZ6fHeoT1DVhpzEme0H3/bC1PAL74gNx2ViontJwXTqaSa1nPYBZqY14u 8GzdZ+G8PI5x76RErcoRVcKWOqtN1nZJKIjbLmQrzg6qDCjF6wy+jGvn3WoQgeD2rT GL5xqtj14sOKqA+UDeRb1P2n/56vPGwkgSALXviIBUDjkCczcUA9uChv93bZZALrsd nxPLTgKSoX7FWcZKMFyo4ZhRpNYVbQjInnPthnJv3FtkvyVfXzSCq2rweIg0b8EsJq 4fztauvXrtrly83hwF3XaGDyZlt3Zr7MyzN25AhyS83yavvlAlBJqbrpJ3vlxm9UCe mU8wVQfrOhVQA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Yfnpx3GPyz9rxB for ; Fri, 24 Jan 2025 20:26:01 +0100 (CET) Date: Fri, 24 Jan 2025 19:26:00 +0000 From: Peter White To: bug-grep@gnu.org Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=185.67.36.65; envelope-from=peter.white@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Fri, Jan 24, 2025 at 01:27:13PM +0000, Andreas BROCKMANN via Bug reports for GNU grep wrote: > Hi, > > 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 As someone who just today made a similar mistake I would like to point out that the pattern does as intended because '*' matches *zero* or more occurrences of the preceding atom. So the second pattern matches any line that contains a *literal* 's' followed by zero or more control chars, which is any line because of the newline at the end which is a control char. Since you did not ask for perl regex (-P) grep uses basic POSIX regex instead; at least I *think* you want perl syntax given that '\s' is only valid in PCRE, IIRC. Also [:cntrl:] is not the correct char class for white space, why not [:space:] or [:blank:]? Your first pattern just happens to match the literal space in it *and* any following string of zero or more control chars. PW From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 17:59:46 2025 Received: (at submit) by debbugs.gnu.org; 24 Jan 2025 22:59:47 +0000 Received: from localhost ([127.0.0.1]:47409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbSeQ-0000K6-G8 for submit@debbugs.gnu.org; Fri, 24 Jan 2025 17:59:46 -0500 Received: from lists.gnu.org ([2001:470:142::17]:46746) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbSeL-0000Je-0U for submit@debbugs.gnu.org; Fri, 24 Jan 2025 17:59:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbSeD-0004d3-FL for bug-grep@gnu.org; Fri, 24 Jan 2025 17:59:34 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbSeA-0006ZA-TG for bug-grep@gnu.org; Fri, 24 Jan 2025 17:59:33 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BF285240027 for ; Fri, 24 Jan 2025 23:59:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1737759568; bh=mpX8nxNOXvKNyhv9FJc9vokRYa22BggHbNFZ1HHAw1o=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:From; b=gFSWFy3KLIiMKDWDeSvJ6tFRPa87pe/Sj+lZ4AMHumOmtcAKKHjQNoBM5WyVv8lj3 t148hgHi+eq2GoMFXEspdXO7LJoThXExhcQgWmdhC5UezcKDl6L+bQR4FVLp6z41XJ lh3JSTmxrGDbDdfqIkzRTD1tt/ytyTgfV1PaVDCkp8safcTcwiGXZ3Y+D0mQLvV8so 9GsMURluQHxX7fTnZxfoeV7lj7nF9Bg+GvdSR7Al/QzRDl1w0leOOj3pAicuUG6sz0 EE6wUYDMRZj2QAF5a03cFX3DddbaADcv+o3e76/WR/kV5C4EsQbYAwAwtwJlxmyXyJ 5Jyqq1kqEojDA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YftYD3p87z9rxF for ; Fri, 24 Jan 2025 23:59:28 +0100 (CET) Date: Fri, 24 Jan 2025 22:59:27 +0000 From: Peter White To: bug-grep@gnu.org Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=185.67.36.65; envelope-from=peter.white@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Fri, Jan 24, 2025 at 07:26:00PM +0000, Peter White wrote: > On Fri, Jan 24, 2025 at 01:27:13PM +0000, Andreas BROCKMANN via Bug reports for GNU grep wrote: > > Hi, > > > > 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 > As someone who just today made a similar mistake I would like to point > out that the pattern does as intended because '*' matches *zero* or more > occurrences of the preceding atom. So the second pattern matches > any line that contains a *literal* 's' followed by zero or more control > chars, which is any line because of the newline at the end which is a > control char. Since you did not ask for perl regex (-P) grep uses basic > POSIX regex instead; at least I *think* you want perl syntax given that > '\s' is only valid in PCRE, IIRC. Turns out that last part is not true, sorry. I was going by the grep(1) man page instead of `info grep`, which does say that '\s' is shorthand for '[[:space:]]'. Still, the 2nd pattern is incorrect. IIUC this is what it should look like: # '-i' is bogus since there is no upper/lower case whitespace grep --color=never -sHn '[[:blank:]][[:cntrl:]]*$' [:blank:] is the more correct char class because '\s' matches anything in the ASCII range 0-31 (plus [127]) and as it so happens is in that range. DOS files have the in front of (a.k.a. '$'), which is why the original pattern did match *correctly*. Contrary to the claim in the OP I could only reproduce the "false" behavior with DOS and not UNIX files. And now I understand why '[[:cntrl:]]' is in the pattern (sorry for my initial misunderstanding). DOS, the gift that keeps on giving. :P Also note the '--color=never'. I don't know how relevant this is on Windows but on my terminal emulator (with --color=auto) the at the end of a line in DOS files would be printed as a match and the terminal obeyed with all the ensuing consequences, leaving empty lines without match text. Another "gift", I guess. PW From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 25 12:08:57 2025 Received: (at submit) by debbugs.gnu.org; 25 Jan 2025 17:08:57 +0000 Received: from localhost ([127.0.0.1]:52273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbjeR-0002kb-AW for submit@debbugs.gnu.org; Sat, 25 Jan 2025 12:08:57 -0500 Received: from lists.gnu.org ([2001:470:142::17]:54630) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbOuo-0002hu-PE for submit@debbugs.gnu.org; Fri, 24 Jan 2025 14:00:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbOud-0004Tm-T0 for bug-grep@gnu.org; Fri, 24 Jan 2025 14:00:17 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbOub-0005hH-Bw for bug-grep@gnu.org; Fri, 24 Jan 2025 14:00:15 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CCCD2240101 for ; Fri, 24 Jan 2025 20:00:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1737745203; bh=RcRXjhbs4XYEaEOEaB5uyTRKZej6vy4hni4ecZg+egY=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:From; b=omeqhupXpRSXzBJurmSKyhhMuJFDpq0zqt+0p0hTkKB2lEqXCInYo/SkpHy1QZOGx 48oZsfDS0oxQnjKgAkSdQamBjMZP9CE+Wub/a/e3O/kZ2EM5N0IEc0vXB/nKtJSQhi TX6G581IhKP6sfnwsMLznehKWa/6Al1auHsUdJURAjRjvUJ55g3XOM6E2XgTbpulWY aKbv0qlGqGNkMCjTWJ5bEi16ZGLCuv9HlHuNrlNHT6+f7mVxJuVBNvImiPQVIyZxa/ p/Nri1wN6qT+ITHPMz267EtHJtfE0V+QgpFKdDV2Js/Ml8lPgldcV4pjaV7kemds9o LrjTW54CoIHqQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YfnDz1NCHz9rxN for ; Fri, 24 Jan 2025 20:00:03 +0100 (CET) Date: Fri, 24 Jan 2025 19:00:02 +0000 From: Marcus Blumhagen To: bug-grep@gnu.org Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=185.67.36.66; envelope-from=marcus.blumhagen@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 25 Jan 2025 12:08:54 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Fri, Jan 24, 2025 at 01:27:13PM +0000, Andreas BROCKMANN via Bug reports for GNU grep wrote: > Hi, > > 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 As someone who just today made a similar mistake I would like to point out that the pattern does as intended because '*' matches *zero* or more occurrences of the preceding atom. So the second pattern matches any line that contains a *literal* 's' followed by zero or more control chars - you did not ask for perl regex and thus got basic POSIX regex instead; at least I *think* you want perl syntax given that '\s' is only valid in PCRE, IIRC. Also [:cntrl:] is not the correct char class for white space, why not [:space:] or [:blank:]? From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 25 14:31:17 2025 Received: (at 75806-done) by debbugs.gnu.org; 25 Jan 2025 19:31:17 +0000 Received: from localhost ([127.0.0.1]:52688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tblsD-0004i7-GU for submit@debbugs.gnu.org; Sat, 25 Jan 2025 14:31:17 -0500 Received: from mail.cs.ucla.edu ([131.179.128.66]:36328) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tblsA-0004hj-DM for 75806-done@debbugs.gnu.org; Sat, 25 Jan 2025 14:31:15 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id F1BEE3C12386C; Sat, 25 Jan 2025 11:31:06 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id LmfQISdc1K6Q; Sat, 25 Jan 2025 11:31:06 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id A8A673C12386A; Sat, 25 Jan 2025 11:31:06 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu A8A673C12386A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1737833466; bh=RbZ5Aj3Gbh3QmuPHG2SLwNMA1pFKJPD2eSZnxq26IXs=; h=Message-ID:Date:MIME-Version:To:From; b=BWEBFaMpbGSL+wQVHvIJ+hezSe6X/I3rjeZECZeJ7w57kb9QcB26qTj/tvRbKdf4e bjBuIZ4tfl5/V+8nc908k/hUbXUjpRSGlmZwz6wa3JiCtstZ2MTfpoiZk4/uESZSf7 fZ2D1zshabd0pIJPNb64Tk4dBZ5UY2oyVo5pRraLAGkp7IB268e1I7PyisnQu40ONL OipLAA9xL05wtonKLSjXY/lTswHTbhRkLmAN5KFOI6MlLG2u2atSiJ8nxWdJB4WPrf Xv/91sTGmLv3OFZ4RQSFDpaPUIP61EWyP0kfdogJ1XU2SqS+pq+k9xZoeaC5k6P3D6 LfFYoV99/6pMw== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 9QrssBmLniw7; Sat, 25 Jan 2025 11:31:06 -0800 (PST) Received: from [192.168.254.12] (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 8C3C43C12386C; Sat, 25 Jan 2025 11:31:06 -0800 (PST) Message-ID: Date: Sat, 25 Jan 2025 11:31:06 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty To: Andreas BROCKMANN References: Content-Language: en-US From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75806-done Cc: "cygwin@cygwin.com" , 75806-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 25 15:42:14 2025 Received: (at 75806-done) by debbugs.gnu.org; 25 Jan 2025 20:42:15 +0000 Received: from localhost ([127.0.0.1]:52855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbmys-0002s2-Kr for submit@debbugs.gnu.org; Sat, 25 Jan 2025 15:42:14 -0500 Received: from smtprelay0011.hostedemail.com ([216.40.44.11]:36798 helo=relay.hostedemail.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbmyp-0002rh-T2 for 75806-done@debbugs.gnu.org; Sat, 25 Jan 2025 15:42:13 -0500 Received: from omf15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 12D931A035C; Sat, 25 Jan 2025 20:42:05 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: Brian.Inglis@SystematicSW.ab.ca) by omf15.hostedemail.com (Postfix) with ESMTPA id 5756A1B; Sat, 25 Jan 2025 20:42:03 +0000 (UTC) Message-ID: <18592f0e-dcb1-4f63-9ecd-5f5ac8dd1146@SystematicSW.ab.ca> Date: Sat, 25 Jan 2025 13:42:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Brian Inglis Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]" faulty Content-Language: en-CA To: 75806-done@debbugs.gnu.org References: Organization: Systematic Software In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5756A1B X-Spam-Status: No, score=2.37 X-Rspamd-Server: rspamout07 X-Stat-Signature: wdae64mttyojy7p46ajc6rygybqbymir X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX18ZpDzlvQCMoBapNkkLr8GbFoowFmKq5J0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SystematicSW.ab.ca; h=message-id:date:mime-version:from:reply-to:subject:to:cc:references:in-reply-to:content-type:content-transfer-encoding; s=he; bh=iVOvFP8jZh7i9w5KsfFiRaoRyOZSjekxU7++JMYmYbs=; b=kIUPKoJGfLeFBbAI4lIruZB6yFHgJBrXklNKeV9GjyyBWwovXzXAhFRlDNljlE1bIeBhGkE02pgScaIYaALumFvEPnIb5DAwOaYrrk44UbkRmTCfvvc7+qtSyg/9BDDKbjnm5N7zDtECUDwBm4d+5hWMaecHxkLpDkPwn9co3V3HluL+2EmSVTA90cNnOO3XgC1PX6NAuT+LkFqXQoWtvDjkvpDrmRpiDuXFdNLH75DHyCorswiHUsemtuWfHPl0oQYXFMmwKVvh9KKHa11szX3lymN05e6q64gOFCRf+sWfTLlwJGkblGAr1Aog49pS95lx9+Pp5jXg6yGNtevcFA== X-HE-Tag: 1737837723-738396 X-HE-Meta: U2FsdGVkX1+m1vl2vuKH3pmM2A5wgQBGClNE31Nkmu/fYoJBt5DGB0iNikpTFrVXkSybXS9Fqde5YFTVL1k8msa20M31L5zp8MiwIteFKx5EJk5nfc/Oaf5RkTKUMhd1a8nKBg0goQrltsVqZW9xnpqLUAE3zKBXxFh3RQTTagKXTkYmJRdTeuQJ14dkOV3Fa9Ky5ntk5a/cS+NeXtFaJOu5tz0jiYAysE/B6UKqD9in+X177uJA1qiRwqmKakyZmYLSO7pG7tR4ReJp0SoqUludczAXx4PbCs1KkT2WGewbhDMTbdHZpQ1DFMEvyV+9FhXM7LevjGGRmLRtuXPAzvhoNPbOA8zm X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75806-done Cc: Andreas BROCKMANN , cygwin@cygwin.com, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: 75806-done@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2025-01-25 12:31, Paul Eggert via Cygwin wrote: > 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. IIRC even Cygwin dropped Windows text handling in coreutils, findutils, grep, sed, etc. about 2018 to be consistent with other POSIX platforms. Use d2u/dos2unix or u2d/unix2dos in pipes to convert, or equivalent, such as tr -d '\r', sed -e 's/\r//g', awk -e '{gsub(/\r/,"")'. Cygwin users may be able to compensate by remounting the filesystem with a "text" mount option -o text or the equivalent in an /etc/fstab entry, but I am unsure if anyone has tested using that option nowadays. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut -- Antoine de Saint-Exupéry From unknown Sun Jun 22 22:44:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 23 Feb 2025 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator