]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
echo -e is not portable. We don't need it, it was used for a few newlines,
authorAidan Van Dyk <aidan@ifax.com>
Wed, 11 Jan 2006 22:05:56 +0000 (22:05 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 11 Jan 2006 22:05:56 +0000 (22:05 +0000)
which can be done with 2 echos, and for getting the \n chagnes out of
$faxstatus, which now uses sed.

CHANGES
util/notify.sh.in

diff --git a/CHANGES b/CHANGES
index 878f43a76456289950285af7a001f645c2299a06..fa71233de5e4589d4c05dd6e33072da24d35a957 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog for HylaFAX 4.2.5
 
+* change notify to not rely on echo -e (BUG 724) (11 Jan 2005)
 * make sure probemodem removes lock files (BUG 691) (9 Jan 2005)
 * portability cleanup to MemoryDecoder.c++ (BUG 224) (9 Jan 2005)
 * include crypt.h where necessary (BUG 722) (9 Jan 2005)
index 21df5ff2f33404a436201c8ba46610f58928a066..1c778500bcf6ccea813caacd4f4601e6f62776cf 100644 (file)
@@ -639,8 +639,8 @@ printStatus()
     if [ -z "$1" ] ; then # 0 string len
         echo "<no reason recorded>"
     else
-        # use -e in echo to interpret escape characters in the line
-        echo -e $1
+        # we need to change the '\n' in the strings to real newlines
+        echo "$1" | sed -e 's/\\n/\n/g'
     fi
 }
 
@@ -737,8 +737,8 @@ if [ "$WHY" = "done" ] ; then
         printf "\nProcessing time was %s.\n" "$JTIME"
     fi
     if [ -n "$faxstatus" -a "$RETURNTRANSCRIPT" = "yes" ] ; then
-        # use -e in echo to interpret escape characters in faxstatus
-        echo -e "  Additional information:\n    " $faxstatus
+        echo "  Additional information:"
+       printStatus "     $faxstatus"
         returnTranscript
     fi
     if [ -n "$RETURNFILETYPE" ] ; then 
@@ -793,9 +793,10 @@ elif [ "$WHY" = "timedout" ]; then
 elif [ "$WHY" = "format_failed" ] ; then 
     putHeaders "$jobtag to $number failed" 
     echo " was not sent because document conversion"
-    echo -e "to facsimile failed.  The output from the converter program was:\n"
-    # use -e in echo to interpret escape characters in faxstatus
-    echo -e $faxstatus "\n"
+    echo "to facsimile failed.  The output from the converter program was:"
+    echo ""
+    printStatus "$faxstatus"
+    echo ""
     echo "Check any PostScript documents for non-standard fonts and invalid constructs"
     returnToSender
 elif [ "$WHY" = "no_formatter" ] ; then 
@@ -820,7 +821,8 @@ else
     putHeaders "Notice about $jobtag" 
     echo " had something happen to it."
     echo "Unfortunately, the notification script was invoked with an unknown reason"
-    echo -e "so the rest of this message is for debugging:\n"
+    echo "so the rest of this message is for debugging:"
+    echo ""
     echo "why: $WHY"
     echo "jobTime: $JTIME"
     echo "nextTry: $NEXT"