bash
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bash [2020/08/12 17:17] – [set options] Formatting shawn | bash [2020/08/12 19:07] (current) – [Functions] Adds tips shawn | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | ''# | ||
====== set options ====== | ====== set options ====== | ||
Line 9: | Line 11: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
* use a + to unset them if necessary | * use a + to unset them if necessary | ||
Line 16: | Line 18: | ||
====== Variables ====== | ====== Variables ====== | ||
- | * $@ - All of the arguments as individual strings | + | * '' |
- | * " | + | * '' |
- | * $# - The number of arguments | + | * '' |
- | * $1..n - Where n is an integer, the nth argument in the list | + | * '' |
- | * $0 - The command name | + | * '' |
- | * $? - The last exit code | + | * '' |
- | * $IFS - Internal/ | + | * '' |
+ | |||
+ | ====== Functions ====== | ||
+ | |||
+ | Declaring a function (needs to happen before use): | ||
+ | |||
+ | '' | ||
+ | |||
+ | - or - | ||
+ | |||
+ | ''< | ||
+ | |||
+ | * Nothing ever goes inside parentheses. | ||
+ | * Passed parameters can be accessed with '' | ||
+ | ====== Tips ====== | ||
+ | * [[https:// |
bash.1597252627.txt.gz · Last modified: 2020/08/12 17:17 by shawn