delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/01/25/15:42:36

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 50PKgYVQ1027625
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 50PKgYVQ1027625
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=qciwjscT
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E81B3858414
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1737837754;
bh=oazCC6OGSQgiMFruyLvLoTO/XhyjRNbXOlDgxnu+dbQ=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=qciwjscTJ+cxmxWsYMHjz2acRjgtFBFc57QEdwq7WwpsvymJHEd9xXpRzTk0AxbhT
/wdSUff3SW/yKzT/XGqtDkAacp1QBORXMmH9EnABI8e+co2rxzlJis10PH965l1rNS
VtGC7AHojaLZozKMlBpaG1AYdbdsMOy9NNddriSs=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA0FA3858414
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BA0FA3858414
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737837725; cv=none;
b=J3OSzxCn//lASqNe5d2OjJ3xoAiZzVU9tly5XdBtraPwelLWyFhGBruzNK2FTHdVZEZ0jvberKf/KTksRGHAmZv00a+B2RR8Y3Ca4l71Qew1A1DijZdHps+0y68tt9dWUrfc77rMNY9dx8Ir12niSv8mnYV6El/MO+jcTLMY01o=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1737837725; c=relaxed/simple;
bh=osj0O3anEUNTpUeGE0JyjTsVaYdaZ+1f0EYgGFaSWus=;
h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature;
b=dRVj3S4sxX5VNVPRfx05gw2E51feIXS4G4tm3vkLJi6QW/b99UgiV69ad/mQpfXvLZk/z22vFa4/nyPDnqqFVElDVxDKGTQ9lA81J6mkXocXT9AluGgrMiJPerE2STlTdo48701rs74ajMV468/Q3LQgC1LY1e7sHOQpfyd0dtg=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA0FA3858414
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
Subject: Re: bug#75806: Trailing spaces; pattern "\s" before "[[:cntrl:]]"
faulty
To: 75806-done AT debbugs DOT gnu DOT org
References: <ad4ae696207443f284d8700791d989ed AT diehl DOT com>
<bfdbce48-47d3-4d52-a359-dd962a319034 AT cs DOT ucla DOT edu>
Organization: Systematic Software
In-Reply-To: <bfdbce48-47d3-4d52-a359-dd962a319034@cs.ucla.edu>
X-Rspamd-Queue-Id: 5756A1B
X-Rspamd-Server: rspamout07
X-Stat-Signature: wdae64mttyojy7p46ajc6rygybqbymir
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX18ZpDzlvQCMoBapNkkLr8GbFoowFmKq5J0=
X-HE-Tag: 1737837723-738396
X-HE-Meta: U2FsdGVkX1+m1vl2vuKH3pmM2A5wgQBGClNE31Nkmu/fYoJBt5DGB0iNikpTFrVXkSybXS9Fqde5YFTVL1k8msa20M31L5zp8MiwIteFKx5EJk5nfc/Oaf5RkTKUMhd1a8nKBg0goQrltsVqZW9xnpqLUAE3zKBXxFh3RQTTagKXTkYmJRdTeuQJ14dkOV3Fa9Ky5ntk5a/cS+NeXtFaJOu5tz0jiYAysE/B6UKqD9in+X177uJA1qiRwqmKakyZmYLSO7pG7tR4ReJp0SoqUludczAXx4PbCs1KkT2WGewbhDMTbdHZpQ1DFMEvyV+9FhXM7LevjGGRmLRtuXPAzvhoNPbOA8zm
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: 75806-done AT debbugs DOT gnu DOT org
Cc: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT ab DOT ca>, cygwin AT cygwin DOT com,
Paul Eggert <eggert AT cs DOT ucla DOT edu>,
Andreas BROCKMANN <andreas DOT brockmann AT diehl DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 50PKgYVQ1027625

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019