From b28b6527f3816093d3ca99c5fef0467d01463d4d Mon Sep 17 00:00:00 2001 From: Christopher Hopper Date: Wed, 3 Nov 2021 22:06:31 +1100 Subject: [PATCH] Add special parameter $_ to bash cheatsheet (#1736) --- bash.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bash.md b/bash.md index a7174eea5..4e038e6ec 100644 --- a/bash.md +++ b/bash.md @@ -754,12 +754,13 @@ 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 | +| Expression | Description | +| ---------- | -------------------------------------- | +| `$?` | Exit status of last task | +| `$!` | PID of last background task | +| `$$` | PID of shell | +| `$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).