uutils / uutils/coreutils

cut: pipe reads fully buffered where GNU allows line-based buffering

Open
#11,581 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

(This has been forwarded from Launchpad Bug #2142228)

Problem

Piping output using stdubf -oL and cut leads to the output being read fully buffered in uutils, whereas GNU allows line-based buffering for cut.

Reproduce

Run a command producing output with a given interval, pipe it to line-buffered stdbuf and cut, then pipe this further to cat.

GNU:

while sleep 1; do echo hello,world; done | stdbuf -oL gnucut -f1 -d, | cat

A line saying "hello" is output every second.

uutils:

while sleep 1; do echo hello,world; done | stdbuf -oL cut -f1 -d, | cat

No output is produced until the buffer is full (takes up to a few minutes), whereupon a large number of lines with "hello" are output.

Note: the sleep time can be reduced to very low numbers (0.001) to produce output quicker and confirm the type of buffering used.

System
  • OS release: Ubuntu 26.04 (Development branch)
  • uutils coreutils version: 0.7.0-0ubuntu1

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 the GNU and uutils commands in the issue, using the reduced sleep interval to observe buffering. Trace the cut command's input and output handling, then verify that piping through stdbuf -oL produces one "hello" line per second rather than waiting for a full buffer; the issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.