GNU bug report logs - #46422
'pr' screws up tabstops in multicolumn outpt?

Previous Next

Package: coreutils;

Reported by: Leonard Janis Robert König <ljrk <at> ljrk.org>

Date: Wed, 10 Feb 2021 13:21:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
To: Leonard Janis Robert König <ljrk <at> ljrk.org>
Cc: 46422 <at> debbugs.gnu.org
Subject: bug#46422: 'pr' screws up tabstops in multicolumn outpt?
Date: Wed, 10 Feb 2021 17:06:49 +0100
Hi,

On Wed, Feb 10, 2021 at 01:42:29PM +0100, Leonard Janis Robert König wrote:
> I'm sorry if I this is not a bug but to be expected, but I thnk pr
> doesn't get the alignment of tabs in multicolumn output right.
> [...]
> Unfortunately the POSIX spec is, in my reading, a bit unclear here. 

I do not think so:

-column
  Produce multi-column output that is arranged in column columns[...].
  The options -e and -i shall be assumed for multiple text-column output.

-e[char][gap]
  Expand each input <tab> to the next greater column position[...].

-i[char][gap]
  In output, replace multiple <space>s with <tab>s wherever[...].

https://pubs.opengroup.org/onlinepubs/009695399/utilities/pr.html
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pr.html

The way I read the POSIX spec, "pr" needs to account for the column
separation by adjusting whitespace while still using tab characters in
the output.

> But I think the behavior of GNU/pr is rather unexpected when printing
> multicolumn source code and not in line what the original authors
> intended.

I concur.

Thanks,
Erik
-- 
[M]ost parts of this industry just work by chance.
                        -- Thomas Gleixner




This bug report was last modified 4 years and 99 days ago.

Previous Next


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