Update bash.md
This commit is contained in:
parent
7a2322761a
commit
0361fa173b
4
bash.md
4
bash.md
|
@ -1,4 +1,4 @@
|
||||||
---
|
(---
|
||||||
title: Bash scripting
|
title: Bash scripting
|
||||||
category: CLI
|
category: CLI
|
||||||
layout: 2017/sheet
|
layout: 2017/sheet
|
||||||
|
@ -217,7 +217,7 @@ echo ${STR^^} #=> "HELLO WORLD!" (all uppercase)
|
||||||
| `${FOO:-val}` | `$FOO`, or `val` if unset (or null) |
|
| `${FOO:-val}` | `$FOO`, or `val` if unset (or null) |
|
||||||
| `${FOO:=val}` | Set `$FOO` to `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) |
|
| `${FOO:+val}` | `val` if `$FOO` is set (and not null) |
|
||||||
| `${FOO:?message}` | Show error message and exit if `$FOO` is unset (or is null) |
|
| `${FOO:?message}` | Show error message and exit if `$FOO` is unset (or null) |
|
||||||
|
|
||||||
Omitting the `:` removes the (non)nullity checks, e.g. `${FOO-val}` expands to `val` if unset otherwise `$FOO`.
|
Omitting the `:` removes the (non)nullity checks, e.g. `${FOO-val}` expands to `val` if unset otherwise `$FOO`.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue