From a420ed0a86e9d315a868ea0b3eb0e965f110629f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 15 Jul 2018 21:06:28 +0200 Subject: [PATCH] escape spaces in stored data for easyer use with `read` --- storage.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage.sh b/storage.sh index f5a0ac6..8bd1b95 100755 --- a/storage.sh +++ b/storage.sh @@ -68,6 +68,8 @@ STRING(){ s;\n;\\n;g; s;\t;\\t;g; s;\r;\\r;g; + s;\+;\\+;g; + s; ;+;g; ' } @@ -77,7 +79,9 @@ UNSTRING(){ s;((^|[^\\])(\\\\)*)\\n;\1\n;g; s;((^|[^\\])(\\\\)*)\\t;\1\t;g; s;((^|[^\\])(\\\\)*)\\r;\1\r;g; + s;((^|[^\\])(\\\\)*)\+;\1 ;g; tX; + s;((^|[^\\])(\\\\)*)\\\+;\1+;g; s;\\\\;\\;g; ' } -- 2.39.2