Util-Linux Archive mirror
 help / color / mirror / Atom feed
From: Remigiusz Leon Suwalski <remigiusz.suwalski@protonmail.ch>
To: Karel Zak <kzak@redhat.com>
Cc: "util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: Re: Piped `column -t` inserts extra newlines since Oct 2023
Date: Tue, 05 Dec 2023 11:22:33 +0000	[thread overview]
Message-ID: <jkAf-CA-4rUJ4xpufgGpkm9pHPUneOPwOpKWAyQ7hyFyv7oyn3mAPB0tqc4hkH5n2Q2oavBo8jFvjdbmA-VjJllFsPAoXDC2M0H2V5pzoJQ=@protonmail.ch> (raw)
In-Reply-To: <20231205102603.csxm6luqnayetva5@ws.net.home>

Hi,
today I also can't reproduce the problem on HEAD of master but found  another file that is not terminated with a newline character for which related issue occurs. (On my machine problem occurs starting from commit 94feb5a2 mentioned earlier but not on its parent). Since input data is larger than previously (7kB), I have uploaded it to a pastebin service [1].

$ curl -O https://pastebin.com/raw/gm65ephM
$ column -t < gm65ephM | sort
__  _.__%   _____-_  ..__________-______.___  ____=_-___-_________________
__  _.__%   _____-_  ..__________-______.___  ____=_-___-_________________
__  _.__%   _____-_  ..__________-______.___  ____=_-___-_________________
(... 51 lines follow ...)

$ column -t < gm65ephM
__  __.__%  _____-_  ..__________-______.___  ____=_-___-_________________      _____________________________________________________________________________
__  __.__%  _____-_  ..__________-______.___  ____=_-___-_________________      _____________________________________________________________________________
__  __.__%  _____-_  ..__________-______.___  ____=_-___-_________________      _____________________________________________________________________________

$ diff <(tr -s ' ' < gm65ephM | wc) <(column -t < gm65ephM | tr -s ' ' | wc)                   1 ✘ 
1c1
<      53     324    7236
---
>      54     270    3834

The problem here is that last column is truncated and the output is significantly smaller. Could you please try reproducing this one? If it can't be done then perhaps something is wrong with my PC and the bug report can be closed.

[1] https://pastebin.com/raw/gm65ephM

Regards,
Leon Suwalski

On Tuesday, December 5th, 2023 at 11:26 AM, Karel Zak <kzak@redhat.com> wrote:


> On Mon, Dec 04, 2023 at 05:26:05PM +0000, Remigiusz Leon Suwalski wrote:
> 
> > Hi,
> > I have discovered that `column` utility behaves oddly when piped to another command, as shown on examples below. I am not sure whether this is a bug or intended behaviour.
> > 
> > First `column` built from sources (commit https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=94feb5a20d23904cc15cd857c4e00f35f495116c):
> > $ echo '_ __ ___ ________ __________ _______' | ./column -t | nl # strange
> > 1 __
> > 2 ___
> > 3 ___
> > 4 _________
> > 5 __________
> > 6 _______
> > $ echo ' __ ___ ________ __________ _______' | ./column -t > file.txt # the same issue as above
> > $ echo ' __ ___ ________ __________ ________' | ./column -t # expected
> > _ __ ___ ________ __________ ________
> 
> 
> I cannot reproduce this on the current devel tree and stable/v2.39
> tree, I see:
> 
> $ echo '_ __ ___ ________ __________ _______' | ./column -t | nl
> 1 _ __ ___ ________ __________ ________
> 
> 
> $ echo ' __ ___ ________ __________ ________' | ./column -t > a
> 
> $ cat a
> _ __ ___ ________ __________ ________
> 
> 
> Karel
> 
> --
> Karel Zak kzak@redhat.com
> 
> http://karelzak.blogspot.com

      reply	other threads:[~2023-12-05 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 17:26 Piped `column -t` inserts extra newlines since Oct 2023 Remigiusz Leon Suwalski
2023-12-05 10:26 ` Karel Zak
2023-12-05 11:22   ` Remigiusz Leon Suwalski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jkAf-CA-4rUJ4xpufgGpkm9pHPUneOPwOpKWAyQ7hyFyv7oyn3mAPB0tqc4hkH5n2Q2oavBo8jFvjdbmA-VjJllFsPAoXDC2M0H2V5pzoJQ=@protonmail.ch' \
    --to=remigiusz.suwalski@protonmail.ch \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).