aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/bash.md
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2021-01-09 20:25:49 +0100
committerjohannst <johannes.stoelp@gmail.com>2021-01-09 20:25:49 +0100
commitce946dc97b38a720a8eb4980bbd43cd702e86614 (patch)
tree1453301bc1e62ccc4dd2abbb5a5b10370f005eaa /src/tools/bash.md
parentb7f4aee7a60b03db06475f2a017706494d9a2d44 (diff)
downloadnotes-ce946dc97b38a720a8eb4980bbd43cd702e86614.tar.gz
notes-ce946dc97b38a720a8eb4980bbd43cd702e86614.zip
update bash/zsh notes
Diffstat (limited to 'src/tools/bash.md')
-rw-r--r--src/tools/bash.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/bash.md b/src/tools/bash.md
index 3f53045..201a6ad 100644
--- a/src/tools/bash.md
+++ b/src/tools/bash.md
@@ -16,9 +16,12 @@
### Parameter
```bash
-# default param
+# default value
bar=${foo:-some_val} # if $foo set, then bar=$foo else bar=some_val
+# alternate value
+bar=${foo:+bla $foo} # if $foo set, then bar="bla $foo" else bar=""
+
# check param set
bar=${foo:?msg} # if $foo set, then bar=$foo else exit and print msg