Skip to content

How to preserve exit status in a pipe? #902

Closed

Description

@Magicloud

In bash, I could ret=command 2>&1 | tee log. Then judging from $ret, following script to deal with log or not.

But in fish, $ret is the output of command. And after the whole command, $status is the status of tee.

What should I do?

Activity

  1. ridiculousfish commented on Jul 3, 2013

    @ridiculousfish
    Member

    Current thinking is to just make this the default. See #763.

    Any objection to closing as a duplicate of that?

  2. Magicloud commented on Jul 3, 2013

    @Magicloud
    Author

    Nop, I will comment in that thread.

  3. locked as resolved and limited conversation to collaborators on Apr 19, 2020
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