GNU bug report logs - #68892
'tr' function | Outputs printed before the command prompts

Previous Next

Package: coreutils;

Reported by: Ricky Tigg <ricky.tigg <at> gmail.com>

Date: Fri, 2 Feb 2024 14:42:01 UTC

Severity: normal

To reply to this bug, email your comments to 68892 AT debbugs.gnu.org.

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#68892; Package coreutils. (Fri, 02 Feb 2024 14:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricky Tigg <ricky.tigg <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 02 Feb 2024 14:42:01 GMT) Full text and rfc822 format available.

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

From: Ricky Tigg <ricky.tigg <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: 'tr' function | Outputs printed before the command prompts
Date: Fri, 2 Feb 2024 16:40:26 +0200
[Message part 1 (text/plain, inline)]
OS: Fedora v86_64. coreutils v.: 9.3. Shell: bash v. 5.2.26.

Hello. Normally outputs are printed after the command prompt; "#" "$" on my
system.

(...)@(...):~$ rpm -ql coreutils | head -2
/usr/bin/[
/usr/bin/arch

Unexpectedly, through a pipe invoking 'tr', outputs are printed before the
command prompts.

(...)@(...):~$ rpm -ql coreutils | head -2 | tr '\n' ' '
/usr/bin/[ /usr/bin/arch (...)@(...):~$

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

Information forwarded to bug-coreutils <at> gnu.org:
bug#68892; Package coreutils. (Fri, 02 Feb 2024 14:58:02 GMT) Full text and rfc822 format available.

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

From: Davide Brini <dave_br <at> gmx.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#68892: 'tr' function | Outputs printed before the command
 prompts
Date: Fri, 2 Feb 2024 15:57:20 +0100
On Fri, 2 Feb 2024 16:40:26 +0200, Ricky Tigg <ricky.tigg <at> gmail.com> wrote:

> OS: Fedora v86_64. coreutils v.: 9.3. Shell: bash v. 5.2.26.
>
> Hello. Normally outputs are printed after the command prompt; "#" "$" on
> my system.
>
> (...)@(...):~$ rpm -ql coreutils | head -2
> /usr/bin/[
> /usr/bin/arch
>
> Unexpectedly, through a pipe invoking 'tr', outputs are printed before the
> command prompts.
>
> (...)@(...):~$ rpm -ql coreutils | head -2 | tr '\n' ' '
> /usr/bin/[ /usr/bin/arch (...)@(...):~$

You're removing newlines, and this causes the prompt to be displayed
immediately after the command output without an intervening newline.

--
D.




This bug report was last modified 295 days ago.

Previous Next


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