Pipes an input buffer through a spawned shell command and captures its stdout.
Writes the input to the child's stdin with drain-aware backpressure handling,
tolerates early-close EPIPE, and rejects on non-zero exit or spawn error.
Parameters
segment: string
The shell command to run (executed with shell: true).
Pipes an input buffer through a spawned shell command and captures its stdout.
Writes the input to the child's stdin with drain-aware backpressure handling, tolerates early-close EPIPE, and rejects on non-zero exit or spawn error.