From e02473bcb57d37d31e1a9e4087be1c15e94ff47f Mon Sep 17 00:00:00 2001 From: Nicolas Zagulajew Date: Thu, 7 Jul 2022 15:09:23 +0200 Subject: [PATCH] add ${PIPESTATUS[c]} special var (#1800) Co-authored-by: Rico Sta. Cruz --- bash.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bash.md b/bash.md index 5d219d347..b9d8eb33f 100644 --- a/bash.md +++ b/bash.md @@ -778,13 +778,14 @@ read -n 1 ans # Just one character ### Special variables -| Expression | Description | -| ---------- | -------------------------------------- | -| `$?` | Exit status of last task | -| `$!` | PID of last background task | -| `$$` | PID of shell | -| `$0` | Filename of the shell script | -| `$_` | Last argument of the previous command | +| Expression | Description | +| ------------------ | -------------------------------------- | +| `$?` | Exit status of last task | +| `$!` | PID of last background task | +| `$$` | PID of shell | +| `$0` | Filename of the shell script | +| `$_` | Last argument of the previous command | +| `${PIPESTATUS[n]}` | return value of piped commands (array) | See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).