From 4d11e80873e6f3bcba2ad0f74343f38ff66c6004 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Fri, 22 Dec 2023 19:30:09 -0600 Subject: [PATCH] Update addMessage.sh: Bug fix: escape & --- scripts/addMessage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/addMessage.sh b/scripts/addMessage.sh index 54781bdeb..3291d35dc 100755 --- a/scripts/addMessage.sh +++ b/scripts/addMessage.sh @@ -38,13 +38,13 @@ TAB="$(echo -e "\t")" # Convert newlines to HTML breaks. MESSAGE="$( echo -en "${MESSAGE}" | awk 'BEGIN { l=0; } { if (++l > 1) printf("
"); printf("%s", $0); }' )" -MESSAGE="${MESSAGE// /  }" +MESSAGE="${MESSAGE// /\ \ }" # Messages may have "/" in them so we can't use that to search in sed, # so use "%" instead, but because it could be in a message (although unlikely), # convert all "%" to the ASCII code. # The pound sign in escaped only to make gvim look nicer. -MESSAGE="${MESSAGE//%/&\#37;}" +MESSAGE="${MESSAGE//%/\&\#37;}" # If ${MESSAGE} contains "*" it hoses up the grep and sed regular expression, so escape it. ESCAPED_MESSAGE="${MESSAGE//\*/\\*}"