你好,我有一個發送電子郵件的shell腳本。 這裏是它如何工作的:文件本身清空
- 它從一個URL讀取HTML,並把 它在文件中
- 遍歷所有的電子郵件和 它從HTML文件中讀取循環
問題是:
- 的HTML文件 幾百個電子郵件,沒有明顯的之後變空原因。 (我把du/thehtml.html放在電子郵件日誌中。)
任何人知道爲什麼?謝謝。
來源:
/usr/local/bin/lynx --source http://www.site.com/email.php?message=1 > /root/lynx.html
read var < /root/lynx.html
if [ -z "$var" ]; then
echo "" > /dev/null
else
/usr/local/bin/lynx --source http://www.site.com/email.php?list=1 > /root/html_mail.html
number=0
OLDIFS = "$IFS"
export IFS=","
read mails < /root/html_mail.html
for mail in $mails; do
echo "To: $mail " > /root/finished_message.html
cat /root/lynx.html >> /root/finished_message.html
/usr/sbin/sendmail "$mail" < /root/finished_message.html
echo ".*. $number. " - ". $mail .*." >> /bin/scripts/email.log
du /root/lynx.html >> /bin/scripts/email.log
number=$((number+1))
done;
IFS = "$OLDIFS"
lynx --source http://www.site.com/email.php?done_with=1
fi
也許張貼源代碼會更好地幫助您接收有用的答案? – Himanshu
只是爲了安全起見:您的原始網址中沒有任何'&'? – phoku
nope,只是改變了域名 –