From 147a3ae4c390dfc186f25b0aba267d7ff23b2151 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 22 Mar 2018 15:41:39 +0000 Subject: [PATCH] documentation fo STORE function svn path=/trunk/; revision=64 --- files.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files.sh b/files.sh index 6c459c5..bf8b7b9 100755 --- a/files.sh +++ b/files.sh @@ -27,8 +27,14 @@ STORE(){ # Store fields from a HTTP GET or POST string in a file # usage: STORE "${QUERY_STRING}" # or: STORE "$(head -n $HTTP_CONTENT_LENGTH)" + # backslashes and newline characters will be escaped in field values, + # the escape symbol is a backslash + # hexadecimal character descriptions (%00 - %FF) will be expanded + # the + character will be converted to [space] + # one line in the output corresponds to exactly one field, so you can + # use grep to filter which fields of a query should be stored printf "$( - printf '&%s' "$@" \ + printf '%s' "$@" \ | sed -r ':X; $bY; N; bX; :Y; s;\+; ;g; s;(\\|5[Cc]);\\\\\\\\;g; s;(\n|%0[Aa]);\\\\n;g; s;(^|&)([^=]+)=;\1\2:;g; s;&;\n;g; s;^\n+;;; s;$;\\n;; s;\n+;\n;g; -- 2.39.2