Code: Select all
set bfile "/www/message.txt"
set cmd "!netstat"
set bwhere 0
bind pub -|- $cmd dumpfile
proc dumpfile {nick handle host chan text } {
global bfile bwhere
set foo [open $bfile r]
while { ! [eof $foo] } {
set line [gets $foo]
if {!$bwhere} {
puthelp "PRIVMSG $chan :$line"
}
}
}
On linux the tcl script I am using ignores the ^M characters and the bot only says the relevant parts but on freebsd i get an empty line for every ^M character. I am currently reading up on regexpr but it still seems daunting to me. Is there a simple way for me to tell the bot to ignore the windows linebreaks?
Thank you for any help you can provide in the regard.
p.s. here is a snippet from the text file so you can see what i mean if needed....Stripping the html code out to would be super awesome but is not required.
Issues with hi-rez - mt=987654.^M
<b><font color=green size=4>Net</font><font color=blue size=4>cool</fon
t> - It's netcool son, netcool. It ain't that hard.^M
^M
^M
^M
^M
^M
^M
^M