From 63d71256f83e5da6479d90d1bbdaf17ad6d31f02 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 5 Apr 2024 23:16:19 +0000 Subject: deploy: c660b71b9689af89bc09671e6a6de7f9943e2709 --- tools/bash.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/bash.html') 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"

Note: prefix/suffix/pattern are expanded as pathnames.

-- cgit v1.2.3