You can use the script like this:
TMPFILE=$(mktemp /tmp/smsgw.out.XXXXXX)
cat >$TMPFILE
TMPFILE2=$(mktemp /tmp/smsgw.out.XXXXXX)
sed -r "s/(<[^>]+>)//g" < $TMPFILE | \
sed "s/</</g" | \
sed "s/>/>/g" | \
sed "s/ / /g" | \
sed "s/&/&/g" > $TMPFILE2
rm $TMPFILE
OUTFILE=$(mktemp /var/spool/sms/outgoing/smsgw.out.XXXXXX)
mv $TMPFILE2 $OUTFILE
echo "SMS queued to $OUTFILE"
'bash' Syntax Highlight powered by GeSHi With sed all html tags are removed and some character entities are replaced by the relevant characters.
This is just an example and does not include all possible conversions which may be required.
By searching on Google "strip html regular expression" you can find more information.