From fa64c49244616e641f7bcdb7eff02b5fb2173f3e Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 3 Jul 2018 17:29:51 +0200 Subject: [PATCH] Added EscapeDoubleQuotes function --- dev/ofunctions.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index d042ead..cdc190c 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -8,7 +8,7 @@ #### OFUNCTIONS FULL SUBSET #### #### OFUNCTIONS MINI SUBSET #### _OFUNCTIONS_VERSION=2.3.0-dev -_OFUNCTIONS_BUILD=2018070202 +_OFUNCTIONS_BUILD=2018070301 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -1257,6 +1257,13 @@ function EscapeSpaces { echo "${string// /\\ }" } +# Usage var=$(EscapeDoubleQuotes "$var") or var="$(EscapeDoubleQuotes "$var")" +function EscapeDoubleQuotes { + local value="${1}" + + echo "${value//\"/\\\"}" +} + function IsNumericExpand { eval "local value=\"${1}\"" # Needed eval so variable variables can be processed