85 |
[[ -z ${value} ]] && die "msetpref(): no \$value given" |
[[ -z ${value} ]] && die "msetpref(): no \$value given" |
86 |
|
|
87 |
# handle escaped strings: |
# handle escaped strings: |
88 |
|
|
89 |
# check if value is an integer -> no escaping |
# check if value is an integer -> no escaping |
90 |
if printf "%d" ${value} > /dev/null 2>&1 |
#if printf "%d" ${value} > /dev/null 2>&1 |
91 |
|
# the better way (only use one! bracket!!) |
92 |
|
if [ "${value}" -eq "${value}" ] > /dev/null 2>&1 |
93 |
then |
then |
94 |
value="${value}" |
value="${value}" |
95 |
|
|
96 |
# check for "false" or "true" -> no escaping |
# check for "false" or "true" -> no escaping |
97 |
elif [[ ${value} = false ]] || [[ ${value} = true ]] |
elif [[ ${value} = false ]] || [[ ${value} = true ]] |
98 |
|
then |
99 |
value="${value}" |
value="${value}" |
100 |
|
|
101 |
# all other values needs escaping |
# all other values needs escaping |