Update bash.md
This commit is contained in:
parent
0361fa173b
commit
bf22b55008
6
bash.md
6
bash.md
|
@ -1,4 +1,4 @@
|
|||
(---
|
||||
---
|
||||
title: Bash scripting
|
||||
category: CLI
|
||||
layout: 2017/sheet
|
||||
|
@ -211,9 +211,10 @@ echo ${STR^} #=> "Hello world!" (uppercase 1st letter)
|
|||
echo ${STR^^} #=> "HELLO WORLD!" (all uppercase)
|
||||
```
|
||||
|
||||
|
||||
### Default values
|
||||
|
||||
| Expression | Description |
|
||||
| ----------------- | -------------------------------------------------------- |
|
||||
| `${FOO:-val}` | `$FOO`, or `val` if unset (or null) |
|
||||
| `${FOO:=val}` | Set `$FOO` to `val` if unset (or null) |
|
||||
| `${FOO:+val}` | `val` if `$FOO` is set (and not null) |
|
||||
|
@ -221,7 +222,6 @@ echo ${STR^^} #=> "HELLO WORLD!" (all uppercase)
|
|||
|
||||
Omitting the `:` removes the (non)nullity checks, e.g. `${FOO-val}` expands to `val` if unset otherwise `$FOO`.
|
||||
|
||||
|
||||
Loops
|
||||
-----
|
||||
{: .-three-column}
|
||||
|
|
Loading…
Reference in New Issue