⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sms2xml

📁 GSM猫管理程序
💻
字号:
#!/bin/sh#This script converts a received text message to XML.#Written by Thomas Dolberg, October 2005#run this script only when a message was received.if [ "$1" != "RECEIVED" ]; then exit; fi;#Extract data from the SMS fileFROM=`formail -zx From: < $2`TEXT=`formail -I "" <$2 | sed -e"1d"`#Save as XML#for some reason the mktemp-command creates two instances of the file if I add the .xml-extension to the FILENAME-variable.FILENAME=`mktemp /var/spool/sms/XML/answerXXXXXX`echo "<?xml version='1.0'?>" >$FILENAME.xmlecho "<SMS>" >>$FILENAME.xmlecho "  <from>$FROM</from>" >>$FILENAME.xmlecho "  <message>$TEXT</message>" >>$FILENAME.xmlecho "</SMS>" >>$FILENAME.xml#Delete the original file without the .xml-extensionrm $FILENAME

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -