Subject: [PATCH sxmo-utils v5 4/8] fix sending sms containing quotes

From: Reed Wade <[email-masked]>
Date: Sat, 10 Oct 2020 15:59:31 +0200

Signed-off-by: Reed Wade <[email-masked]>
---
 scripts/modem/sxmo_modemsendsms.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/modem/sxmo_modemsendsms.sh b/scripts/modem/sxmo_modemsendsms.sh
index 9910dae..df40ae9 100755
--- a/scripts/modem/sxmo_modemsendsms.sh
+++ b/scripts/modem/sxmo_modemsendsms.sh
@@ -32,10 +32,11 @@ else
 
 	TEXT="$@"
 fi
+TEXT="$(echo "$TEXT" | sed "s/\"/'/g" | sed "s/\`/'/g")"
 TEXTSIZE="${#TEXT}"
 
 SMSNO="$(
-	mmcli -m "$MODEM" --messaging-create-sms="text='$TEXT',number=$NUMBER" |
+	mmcli -m "$MODEM" --messaging-create-sms="text=\"$TEXT\",number=$NUMBER" |
 	grep -o "[0-9]*$"
 )"
 mmcli -s "${SMSNO}" --send || err "Couldn't send text message"
-- 
2.28.0