Added EscapeDoubleQuotes function

This commit is contained in:
deajan 2018-07-03 17:29:51 +02:00
parent cf609998aa
commit fa64c49244
1 changed files with 8 additions and 1 deletions

View File

@ -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