add ${PIPESTATUS[c]} special var (#1800)

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
This commit is contained in:
Nicolas Zagulajew 2022-07-07 15:09:23 +02:00 committed by GitHub
parent d62209edf3
commit e02473bcb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

15
bash.md
View File

@ -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).