From 4ebfabeb0a29e58e6ac06435601b81ad11c564d9 Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 14 Jan 2021 21:30:05 +0000 Subject: deploy: 4de58de1947bf4fcfe16db8e9d2c9c920b1441d1 --- tools/bash.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/bash.html') diff --git a/tools/bash.html b/tools/bash.html index 1f3b722..cf5a5ed 100644 --- a/tools/bash.html +++ b/tools/bash.html @@ -81,7 +81,7 @@ @@ -160,9 +160,12 @@ {a,b}{c,d}

Parameter

-
# 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
 
-- 
cgit v1.2.3