From fc8ef801a42971a8557829110f29b3317a60688c Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 2 Sep 2016 21:18:18 +0200 Subject: [PATCH] Fix EscapeSpaces on bash >= 4.3 --- dev/ofunctions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 7c5fe09..38b9226 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,6 +1,6 @@ #### MINIMAL-FUNCTION-SET BEGIN #### -## FUNC_BUILD=2016090203 +## FUNC_BUILD=2016090204 ## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## To use in a program, define the following variables: @@ -831,9 +831,10 @@ function StripQuotes { echo "$(StripSingleQuotes $(StripDoubleQuotes $string))" } +# Usage var=$(EscapeSpaces "$var") or var="$(EscapeSpaces "$var")" function EscapeSpaces { local string="${1}" # String on which spaces will be escaped - echo "${string// /\ }" + echo "${string// /\\ }" } function IsNumeric {