Skip to content

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

Open

Description

@BAMF0

(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

Activity

  1. oech3 commented on Apr 1, 2026

    @oech3
    Contributor

    see also #7967

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