help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Not to set PIPESTATUS unless necessary


From: Koichi Murase
Subject: Re: Not to set PIPESTATUS unless necessary
Date: Thu, 9 May 2024 12:16:42 +0900

It's not as clean as you expect, but for example, you may define

  pipesaved() { eval "$1
  pipesaved=(\"\${PIPESTATUS[@]}\")"; }

and use it as

  pipesaved 'true | true'
  false
  echo "${pipesaved[@]}"

--
Koichi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]