24 lines
411 B
Markdown
24 lines
411 B
Markdown
# Unix Shell
|
|
|
|
## Manuals you'd need
|
|
|
|
### Testing
|
|
|
|
If you want to test a string, value or a path, you can use `[`
|
|
|
|
E.g.
|
|
|
|
`[ 1 = 1 ]` will return 0, which means true
|
|
|
|
### Getting Values from CLI
|
|
|
|
Usually, `$#` means number of arguments, while `$1`, `$2` ... returns the argument.
|
|
|
|
Special cases:
|
|
|
|
1. `$@` returns all arguments
|
|
2. `$0` returns the program itself
|
|
|
|
> Pro tip: there are multiple ways to do this :)
|
|
|