| tr -d '\n'

This commit is contained in:
qo-op 2021-07-12 20:12:29 +02:00
parent b8286d72ca
commit bc0763e99a
1 changed files with 3 additions and 3 deletions

View File

@ -41,13 +41,13 @@ PHONE="$SMS_1_NUMBER" # gammu-smsd
[[ ${PHONE#"$prefix"} != "${PHONE}" ]] && phone=0${PHONE#"$prefix"} || phone="${PHONE}"
TEXT=""
rm -f /tmp/sms_message
rm -f /tmp/sms_incoming
PROGRAM=/bin/echo
for i in `seq $SMS_MESSAGES` ; do
eval "$PROGRAM \"\${SMS_${i}_TEXT}\"" >> /tmp/sms_message
eval "$PROGRAM \"\${SMS_${i}_TEXT}\"" >> /tmp/sms_incoming
done
TEXT="$(cat /tmp/sms_message)"
TEXT="$(cat /tmp/sms_incoming | tr -d '\n')"
[[ ! ${TEXT} ]] && TEXT="$2" # CLI MODE
[[ "${TEXT}" == "" ]] && echo "SMS IS EMPTY - EXIT -" && exit 1