Skip to content

Commit

Permalink
Updated description for arguments section (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
matildeopbravo committed Feb 18, 2021
1 parent 39f62fc commit 8646bb2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions bash.md
Expand Up @@ -343,13 +343,16 @@ fi

### Arguments

| Expression | Description |
| --- | --- |
| `$#` | Number of arguments |
| `$*` | All arguments |
| `$@` | All arguments, starting from first |
| `$1` | First argument |
| `$_` | Last argument of the previous command |
| Expression | Description |
| --- | --- |
| `$#` | Number of arguments |
| `$*` | All postional arguments (as a single word) |
| `$@` | All postitional arguments (as separate strings) |
| `$1` | First argument |
| `$_` | Last argument of the previous command |

**Note**: `$@` and `$*` must be quoted in order to perform as described.
Otherwise, they do exactly the same thing (arguments as separate strings).

See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).

Expand Down

0 comments on commit 8646bb2

Please sign in to comment.