Skip to content

pr: flags -T and -s behave differently than in GNU pr #12313

Open

Description

@schragge

Test case: transposing a simple table.
Input data (in.csv):

A,1,2,3
B,1,2,3
C,1,2,3

Used command:

<in.csv tr , \\n | pr -3Ts,

Expected output:

A,B,C
1,1,1
2,2,2
3,3,3

Works as expected with GNU pr 9.5.

The output of uutils pr -3 -FTs,

A                      ,B                      ,C
1                      ,1                      ,1
2                      ,2                      ,2
3                      ,3                      ,3

Differences:

  • uutils pr requires number of columns to be specified separately: pr -3 -Ts, otherwise, the following flags don't get processed;
  • for -T to work, it requires -F as well: pr -3 -FTs,, otherwise, -T doesn't work;
  • columns get aligned unconditionally, even when -s, is specified. No difference between -s, and -S,. In GNU pr, the columns only get aligned with the -S flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions