]> git.plutz.net Git - cgilite/commitdiff
documentation fo STORE function
authorpaul <paul@plutz.net>
Thu, 22 Mar 2018 15:41:39 +0000 (15:41 +0000)
committerpaul <paul@plutz.net>
Thu, 22 Mar 2018 15:41:39 +0000 (15:41 +0000)
svn path=/trunk/; revision=64

files.sh

index 6c459c524d615105c89c8457abb58a6249696b9f..bf8b7b9f44343d3c210c57800b5e606208f6e6b2 100755 (executable)
--- 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)"
   # 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 "$(
-  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;
   | 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;