Skip to content

Permit combining stdout/stderr as streams to external command behind pipe #9673

@x10an14

Description

@x10an14

Question

Given command foo, which outputs both stdout and stderr, how can I pipe both of stdout and stderr from foo into bar through a pipe?

Ref these (non-exhaustive list of) alternatives which achieve this in bash:

foo |& bar
foo 2>&1 | bar

Additional context and details

The only way for me to automate checking of my flake.nix checks (in a nice graphical output) in Nushell when using nom now is this arcane invocation:

bash -c 'nix flake check --log-format internal-json -vv |& nom --json'

Feels weird that I cannot do the equivalent of "combine outputs and redirect them through pipe" in Nushell =S

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:redirection-pipeAll related to redirection to files or more complex pipelines with STDERRA:streamingIssues related to streaming data (or collecting data when it should be streamed)category:enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions