Add special parameter $_ to bash cheatsheet (#1736)

This commit is contained in:
Christopher Hopper 2021-11-03 22:06:31 +11:00 committed by GitHub
parent 3bf1169205
commit b28b6527f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

13
bash.md
View File

@ -754,12 +754,13 @@ read -n 1 ans # Just one character
### Special variables ### Special variables
| Expression | Description | | Expression | Description |
| ---------- | ---------------------------- | | ---------- | -------------------------------------- |
| `$?` | Exit status of last task | | `$?` | Exit status of last task |
| `$!` | PID of last background task | | `$!` | PID of last background task |
| `$$` | PID of shell | | `$$` | PID of shell |
| `$0` | Filename of the shell script | | `$0` | Filename of the shell script |
| `$_` | Last argrument of the previous command |
See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables). See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).