24 lines
399 B
Markdown
24 lines
399 B
Markdown
|
# arguments.
|
||
|
## all arguments.
|
||
|
```bash
|
||
|
local everything="$@" # all passed arguments.
|
||
|
```
|
||
|
|
||
|
## script name.
|
||
|
```bash
|
||
|
local name="$0" # name of a script.
|
||
|
local path=$(realpath $0) # full path to a script.
|
||
|
```
|
||
|
|
||
|
## count.
|
||
|
```bash
|
||
|
local count="$#" # argument count.
|
||
|
```
|
||
|
|
||
|
## slice.
|
||
|
```bash
|
||
|
local from2toEnd="${@:2}" # all arguments starting from 2nd.
|
||
|
# and the rest from array manipulations.
|
||
|
```
|
||
|
|