]> git.plutz.net Git - cgilite/blobdiff - index.cgi
replace echo by the more unambiguous builtin printf
[cgilite] / index.cgi
index 9c068b54435e49f0d723e318b71a265f796be681..af99fe150b67db0149b81858603d69e9a2b1c17d 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -36,7 +36,7 @@ _EXEC="${real%/shcgi/index.cgi}"  #execution directory
 # basic functions
 debug() { #change to false to disable debugging
   if [ "$DBG_ENABLED" = true -a -n "$*" ]; then
-    echo -E "$@" >>"$DBG_FILE"
+    printf '%s\n' "$*" >>"$DBG_FILE"
   elif [ "$DBG_ENABLED" = true -a -z "$*" ]; then
     tee -a "$DBG_FILE"
   elif [ -z "$*" ]; then
@@ -45,8 +45,8 @@ debug() { #change to false to disable debugging
 }
 
 die() {
-  debug "$@"
-  echo -E "$@" >>/dev/stderr
+  debug FATAL: "$*"
+  printf '%s\n' "$*" >&2
   exit 1
 }
 
@@ -76,8 +76,6 @@ cgi_get
 
 if [ -n "$_GET[\"action\"]" ]; then
   . "$_EXEC/shcgi/action.sh"
-elif [ -n "$_GET[\"export\"]" ]; then
-  . "$_EXEC/shcgi/export.sh"
 else
   . "$_EXEC/shcgi/page.sh"
 fi