EAPI9-PIPESTATUS.ECLASS

Section: eclass-manpages (5)
Updated: Mar 2025
Index Return to Main Contents

NAME

eapi9-pipestatus.eclass - check the PIPESTATUS array

DESCRIPTION

A stand-alone implementation of a possible future pipestatus command (which would be aimed for EAPI 9). It is meant as a replacement for "assert". In its simplest form it can be called like this:

foo | bar pipestatus || die

With the -v option, the command will also echo the pipe status array, so it can be assigned to a variable like in the following example:

local status foo | bar status=$(pipestatus -v) || die "foo | bar failed, status ${status}"

Caveat: "pipestatus" must be the next command following the pipeline. In particular, the "local" declaration must be before the pipeline, otherwise it would reset the status.

SUPPORTED EAPIS

7 8

FUNCTIONS

pipestatus [-v]
Check the PIPESTATUS array, i.e. the exit status of the command(s) in the most recently executed foreground pipeline. If called with option -v, also output the PIPESTATUS array.

Return value: last non-zero element of PIPESTATUS, or zero if all are zero

AUTHORS

Ulrich Müller <[email protected]>

MAINTAINERS

Ulrich Müller <[email protected]>

REPORTING BUGS

Please report bugs via https://bugs.gentoo.org/

FILES

eapi9-pipestatus.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/eapi9-pipestatus.eclass


Index

NAME
DESCRIPTION
SUPPORTED EAPIS
FUNCTIONS
AUTHORS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:01 GMT, March 25, 2025