| View previous topic :: View next topic |
| Author |
Message |
rvwinkle Guest
|
Posted: Sat Jun 26, 2004 11:55 am Post subject: BSD linebreaks issue revisited |
|
|
Hello I have asked and received much help from this forum on this and similar topics however i am still stumped by an issue my eggdrop has on bsd (mandrake works fine) with a script I pieced together to echo the contents of a file in my irc channel.
| Code: |
set cmd "!netstat"
bind pub -|- $cmd log:pub
proc htmltotext {text} {
regsub -all -- {<br>} $text "\n" text
regsub -all -- {</b>|</font>} $text { } text
regsub -all -- {<[^>]*>} $text {} text
regsub -all -- { |[<*>]} $text { } text
return $text
}
proc log:pub {nick handle host chan text } {
set foo [open "/www/message.txt" "r"]
foreach line [split [read $foo] \n] {
if {($line == "") || ($line == "\n") || ($line == "\r")} { continue }
putserv "PRIVMSG $nick :[htmltotext \002$line\002]"
}
close $foo
}
bind time - "*6 % % % %" displayecho
proc displayecho {min hour day month year} {
set foo [open "/www/message.txt" "r"]
foreach line [split [read $foo] \n] {
if {($line == "") || ($line == "\n") || ($line == "\r")} { continue }
putserv "PRIVMSG #isg :[htmltotext \002$line\002]"
}
close $foo
}
|
This is what the file it echos looks like in vi
| Code: |
Iplanet BL, MT 2382446.^M
It's NetCool son, NetCool. It ain't that hard.^M
Baltimore edge 4 will be rebooted sometime within the next hour (4-5pm).^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
^M
~
|
I have used eggdrop.conf to prevent dupe messages in queue to keep it from going crazy on all the windows linebreaks but I would love to keep it from pasting the one empty line I am still getting. I am thinking my issue may be the leading space on most of the ^M lines but I cant get it to stop adding one blank line at the end of its spew. Can anyone provide any additional assistance in this regard? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|