Re: Piped `column -t` inserts extra newlines since Oct 2023

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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@xxxxxxxxxx
> 
> http://karelzak.blogspot.com





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux