GNU bug report logs - #58468
bug in my tr, version (GNU coreutils) 9.1

Previous Next

Package: coreutils;

Reported by: Anton Wessel <Anton_Wessel <at> t-online.de>

Date: Wed, 12 Oct 2022 13:20:02 UTC

Severity: normal

Tags: notabug

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 58468 in the body.
You can then email your comments to 58468 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-coreutils <at> gnu.org:
bug#58468; Package coreutils. (Wed, 12 Oct 2022 13:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Anton Wessel <Anton_Wessel <at> t-online.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 12 Oct 2022 13:20:02 GMT) Full text and rfc822 format available.

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

From: Anton Wessel <Anton_Wessel <at> t-online.de>
To: <bug-coreutils <at> gnu.org>
Subject: bug in my tr, version (GNU coreutils) 9.1
Date: Wed, 12 Oct 2022 00:47:59 +0200
[Message part 1 (text/plain, inline)]
in OS KNOPPIX 9.1

your email:
+++++

Verzeichnis: Anton_Wessel <at> t-onli…/INBOX
Betreff: Welcome to the "Bug-coreutils" mailing list (Digest mode)
Von: bug-coreutils-request <at> gnu.org
An: Anton_Wessel <at> t-online.de
Datum: 12. Okt.  00:19
Reply-To: bug-coreutils-request <at> gnu.org
Message-ID: <mailman.163.1665526797.1198.bug-coreutils <at> gnu.org>
Größe: 3,29 KB


-----

test:

echo -e "a\n\nb" | tr -s '\n'

or

echo -e "a\n\nb" | tr -s '\n' '\n'

both empty lines are removed, not only one.

Please: is there a wayaround known?


Regards

Anton_Wessel <at> t-online.de

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

Information forwarded to bug-coreutils <at> gnu.org:
bug#58468; Package coreutils. (Wed, 12 Oct 2022 14:22:02 GMT) Full text and rfc822 format available.

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

From: Chris Elvidge <celvidge001 <at> gmail.com>
To: Anton Wessel <Anton_Wessel <at> t-online.de>, 58468 <at> debbugs.gnu.org
Subject: Re: bug#58468: bug in my tr, version (GNU coreutils) 9.1
Date: Wed, 12 Oct 2022 15:21:16 +0100

On 11/10/2022 23:47, Anton Wessel wrote:
> in OS KNOPPIX 9.1
> 
> your email:
> +++++
> 
> Verzeichnis: Anton_Wessel <at> t-onli…/INBOX
> Betreff: Welcome to the "Bug-coreutils" mailing list (Digest mode)
> Von: bug-coreutils-request <at> gnu.org
> An: Anton_Wessel <at> t-online.de
> Datum: 12. Okt.  00:19
> Reply-To: bug-coreutils-request <at> gnu.org
> Message-ID: <mailman.163.1665526797.1198.bug-coreutils <at> gnu.org>
> Größe: 3,29 KB
> 
> 
> -----
> 
> test:
> 
> echo -e "a\n\nb" | tr -s '\n'
> 
> or
> 
> echo -e "a\n\nb" | tr -s '\n' '\n'

You have only one empty line! You need 3 \n to get two empty lines.

$ echo -e "a\n\n\nb"
a


b


> 
> both empty lines are removed, not only one.
> 
> Please: is there a wayaround known?
> 
> 
> Regards
> 
> Anton_Wessel <at> t-online.de
> 
> 

Put your output through hexdump -c
You will see:

$ echo -e "a\n\n\nb" | hexdump -c
0000000   a  \n  \n  \n   b  \n
0000006

$ echo -e "a\n\n\nb" | tr -s '\n' | hexdump -c
0000000   a  \n   b  \n
0000004




Added tag(s) notabug. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 12 Oct 2022 18:13:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 58468 <at> debbugs.gnu.org and Anton Wessel <Anton_Wessel <at> t-online.de> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 12 Oct 2022 18:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Nov 2022 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 220 days ago.

Previous Next


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