fixed problem with single quotes

This commit is contained in:
overflowerror 2022-03-30 21:32:48 +02:00
parent 6b398f2571
commit 0964fdc24f

View file

@ -13,7 +13,7 @@ template() {
_dumpRawBuffer() {
# {{ can not occour in raw _buffer
_script+="printf '%s' $(printf "{{%s{{" "$_buffer" | sed "s/'/\\\'/g" | sed "s/{{/'/g")"
_script+="printf '%s' $(printf "{{%s{{" "$_buffer" | sed "s/'/'\"'\"'/g" | sed "s/{{/'/g")"
_script+=$'\n'
_buffer=""
}
@ -90,6 +90,6 @@ template() {
printf '%s' "$@"
}
#echo "$_script"
echo "$_script" >&2
eval "$_script"
}