From e25125fbfc2ec48f2df7a21aea361b0e4a3dd422 Mon Sep 17 00:00:00 2001 From: Marc Jay Date: Sun, 26 Apr 2020 00:40:27 +0100 Subject: [PATCH] Ensure that hyphen is at end of tr string to prevent 'reverse collating sequence order' error in GNU tr Stop echo from adding newlines using `-n`, removing the need to stop replacing new-line characters with underscores Fixes #573 --- include/outputs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/outputs b/include/outputs index 4e61c0c3..f5455aec 100644 --- a/include/outputs +++ b/include/outputs @@ -201,7 +201,7 @@ generateJsonAsffOutput(){ --arg ACCOUNT_NUM "$ACCOUNT_NUM" \ --arg TITLE_TEXT "$TITLE_TEXT" \ --arg MESSAGE "$(echo -e "${message}" | sed -e 's/^[[:space:]]*//')" \ - --arg UNIQUE_ID "$(LC_ALL=C echo -e "${message}" | tr -cs '[:alnum:]._~-\n' '_')" \ + --arg UNIQUE_ID "$(LC_ALL=C echo -e -n "${message}" | tr -cs '[:alnum:]._~-' '_')" \ --arg STATUS "$status" \ --arg SEVERITY "$severity" \ --arg TITLE_ID "$TITLE_ID" \