Skip to content

Commit

Permalink
add ${PIPESTATUS[c]} special var (rstacruz#1800)
Browse files Browse the repository at this point in the history
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
  • Loading branch information
freeeflyer and rstacruz committed Jul 7, 2022
1 parent d62209e commit e02473b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit e02473b

Please sign in to comment.