mispipe

pipes two commands and returns the exit status of the first command

TLDR

Run pipeline returning first command exit status
$ mispipe "[command1]" "[command2]"
Use in shell pipeline
$ mispipe "cat /nonexistent" "head -n 5"; echo $?

SYNOPSIS

mispipe command1 command2

DESCRIPTION

mispipe pipes two commands but returns the exit status of the first command instead of the last. Unlike regular shell pipes that return the final command's exit status. Part of moreutils collection.

PARAMETERS

command1

First command (source).
command2
Second command (sink).

INSTALL

sudo apt install moreutils
sudo dnf install moreutils
sudo pacman -S moreutils
sudo apk add moreutils
sudo zypper install moreutils
brew install moreutils
nix profile install nixpkgs#moreutils

SEE ALSO

pee(1), sponge(1)