This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

BSD linebreaks issue revisited

Old posts that have not been replied to for several years.
Locked
r
rvwinkle

BSD linebreaks issue revisited

Post by rvwinkle »

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: Select all

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: Select all

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?
Locked