mirror of
https://github.com/deajan/obackup.git
synced 2024-12-26 07:23:41 +01:00
Fix EscapeSpaces on bash >= 4.3
This commit is contained in:
parent
3b090d8e43
commit
fc8ef801a4
@ -1,6 +1,6 @@
|
|||||||
#### MINIMAL-FUNCTION-SET BEGIN ####
|
#### 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
|
## 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:
|
## To use in a program, define the following variables:
|
||||||
@ -831,9 +831,10 @@ function StripQuotes {
|
|||||||
echo "$(StripSingleQuotes $(StripDoubleQuotes $string))"
|
echo "$(StripSingleQuotes $(StripDoubleQuotes $string))"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Usage var=$(EscapeSpaces "$var") or var="$(EscapeSpaces "$var")"
|
||||||
function EscapeSpaces {
|
function EscapeSpaces {
|
||||||
local string="${1}" # String on which spaces will be escaped
|
local string="${1}" # String on which spaces will be escaped
|
||||||
echo "${string// /\ }"
|
echo "${string// /\\ }"
|
||||||
}
|
}
|
||||||
|
|
||||||
function IsNumeric {
|
function IsNumeric {
|
||||||
|
Loading…
Reference in New Issue
Block a user