uutils / uutils/coreutils

pr: incorrectly interprets argument to -n

Open
#10,302 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - pr
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Environment: uutils main branch (git commit 799de29ec1439401df47434a207d0180a686522b), GNU pr version 9.9

Steps to reproduce:

echo "abc" > f && pr -n f

What happens now: uutils pr waits for user input on stdin.

What I expected to happen: GNU pr correctly renders the file f with line numbers:



2026-01-17 21:36                        f                         Page 1


    1   abc

<truncated lots of blank lines below...>

Notes: I believe uutils pr is incorrectly interpreting the argument f as the argument to -n.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing echo "abc" > f && pr -n f in the uutils pr implementation and compare its argument parsing with GNU pr. Trace why f is consumed as the -n argument; done means the command reads file f, does not wait on stdin, and renders numbered output like GNU pr.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.