diff options
Diffstat (limited to 'tools/bash.html')
-rw-r--r-- | tools/bash.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/bash.html b/tools/bash.html index 91d44cb..c990d81 100644 --- a/tools/bash.html +++ b/tools/bash.html @@ -213,6 +213,11 @@ ${foo/pattern/string} # replace pattern with string when expanding foo # '/' replace all occurences of pattern # '#' pattern match at beginning # '%' pattern match at end + +# set programmatically with priintf builtin +printf -v "VAR1" "abc" +NAME=VAR2 +printf -v "$NAME" "%s" "def" </code></pre> <blockquote> <p>Note: <code>prefix</code>/<code>suffix</code>/<code>pattern</code> are expanded as <a href="#pathname">pathnames</a>.</p> |