stdbuf
Control stdout/stderr/stdin buffering for a command (unbuffered, line-buffered, or byte size). Diagnose output delays and ordering issues in pipelines with safety timeout and dry-run preview.
Instructions
Run a command with controlled stdout/stderr/stdin buffering: 0=none (unbuffered), L=line-buffered, or a byte size. Executes as a subprocess, captures bounded stdout/stderr, and enforces a safety timeout. Use --dry_run to preview without execution. Defaults to system buffering when no mode is set. Use to diagnose buffering-related output delays or ordering issues in pipelines. Not for CPU priority control — use 'nice'. Not for time-bounded execution — use 'timeout'. See also 'nice', 'timeout'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command_args | No | Command and arguments to run. | |
| dry_run | No | Report without running the command. | |
| error | No | Requested stderr buffering mode: 0, L, or a byte size. | |
| input | No | Requested stdin buffering mode: 0, L, or a byte size. | |
| max_output_bytes | No | Maximum captured stdout/stderr bytes each. | |
| output | No | Requested stdout buffering mode: 0, L, or a byte size. | |
| timeout | No | Safety timeout for the command. |