Updated description for arguments section (#1620)
This commit is contained in:
parent
39f62fc3e9
commit
8646bb2c89
17
bash.md
17
bash.md
|
@ -343,13 +343,16 @@ fi
|
||||||
|
|
||||||
### Arguments
|
### Arguments
|
||||||
|
|
||||||
| Expression | Description |
|
| Expression | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `$#` | Number of arguments |
|
| `$#` | Number of arguments |
|
||||||
| `$*` | All arguments |
|
| `$*` | All postional arguments (as a single word) |
|
||||||
| `$@` | All arguments, starting from first |
|
| `$@` | All postitional arguments (as separate strings) |
|
||||||
| `$1` | First argument |
|
| `$1` | First argument |
|
||||||
| `$_` | Last argument of the previous command |
|
| `$_` | 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).
|
See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue