[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Split long message
From: |
Andrea Ganduglia |
Subject: |
Split long message |
Date: |
Sat, 24 Sep 2005 15:14:30 +0200 |
address@hidden, when I sent long message Gnokii sends only first 140bytes and
is ok. I wrote a little (and terribile) script to spilit message
before it was send.
#!/bin/bash
#Input file ---
SMSTEXT=$1
# Part x of n
FRASE='# Part XX of NN #'
# SMS size limit (bytes)
SIZELIMIT="140"
# The script
SOTTR=`echo ${#FRASE}`
SIZELIMIT=$(($SIZELIMIT-$SOTTR))
split -b $SIZELIMIT -d $SMSTEXT part
LASTPART=`ls -1 part* | tail -1 | sed -e 's/part//g'`
for i in part*; do
PARTHERE=`echo $i | sed -e 's/part//g'`
ENDMSG=`echo $FRASE | sed -e "s/XX/$PARTHERE/g"`
ENDMSG=`echo $ENDMSG | sed -e "s/NN/$LASTPART/g"`
echo -n "$ENDMSG" >> $i
# Here I WANT manipulate header of message
cat $i | gnokii --sendsms <phonenumber>
done
In this way gnokii sends two or more sms, while I want it send one
message in two o more parts, that is two or more messages with
identical "Protocol Identifier".
Thx.
--
Openclose.it - Idee per il software libero
http://www.openclose.it
- Split long message,
Andrea Ganduglia <=