<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/12435" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2006-09-19T05:15:23-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/12435</id>

		<entry>
		<author><name><![CDATA[honeybee]]></name></author>
		<updated>2006-09-19T05:15:23-04:00</updated>

		<published>2006-09-19T05:15:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66442#p66442</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66442#p66442"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66442#p66442"><![CDATA[
<blockquote class="uncited"><div>##################################################################################<br>#<br># Grep TCL Port<br># <a href="http://perpleXa.net" class="postlink">http://perpleXa.net</a> | <a href="http://dev.perpleXa.net" class="postlink">http://dev.perpleXa.net</a><br># #perpleXa on QuakeNet<br># (C) perpleXa 2003-2004<br>#<br># ------------------------------------------------------------------------------<br># This program is free software; you can redistribute it and/or<br># modify it under the terms of the GNU General Public License<br># as published by the Free Software Foundation; either version 2<br># of the License, or (at your option) any later version.<br>#<br># This program is distributed in the hope that it will be useful,<br># but WITHOUT ANY WARRANTY; without even the implied warranty of<br># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br># GNU General Public License for more details.<br>#<br># You should have received a copy of the GNU General Public License<br># along with this program; if not, write to the Free Software<br># Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.<br># ------------------------------------------------------------------------------<br>#<br>##################################################################################<br>#<br># Usage: grep [-ivl num] resource pattern<br>#        i        - ignore upper/lower case distinctions during comparisons<br>#        v        - invert the sense of matching, to select non-matching lines<br>#        l num    - list max &lt;num&gt; amounts of lines (20 by default)<br>#        resource - an absolute or relative path<br>#               ie: /dev/null/*<br>#        pattern  - a perl compatible regular expression (PCRE)<br>#               ie: #channel2|user9|Cleanup or [a-z]{7}\s[0-9]{2}<br>#<br>##################################################################################<br><br><br>bind pub  n|- {$grep} grep<br>bind dcc  n|-   grep  grep:dcc<br><br><br>proc grep {nickname hostname handle channel arguments} {<br><br>  set arguments [grep:clean $arguments]     ;# clean the arguments (better solution than [split])<br><br>  set offset   0                            ;# for optional parameters<br>  set  limit  20                            ;# the default output limit<br>  set option  [join [lindex $arguments 0]]  ;# first check<br><br>  if {[regexp -- {^-(\S+)$} [lindex $arguments 0] tmp option]} {<br>    if {[regexp -- {^([ivl]{1,3})$} $option]} {<br>      if {[regexp -- {l} $option]} {<br>        set offset 2<br>        regexp -- {^([0-9]+)$} [join [lindex $arguments 1]] tmp limit<br>      } else {<br>        set offset 1<br>      }<br>    } else {<br>      putquick "NOTICE $nickname :unknown option \"$option\""<br>      return<br>    }<br>  }<br><br>  if {[llength $arguments] &lt; [expr $offset + 2]} {<br>    putquick "NOTICE $nickname :Usage: grep \[-ivl num\] resource pattern"<br>    putquick "NOTICE $nickname :       i        - ignore upper/lower case distinctions during comparisons"<br>    putquick "NOTICE $nickname :       v        - invert the sense of matching, to select non-matching lines"<br>    putquick "NOTICE $nickname :       l num    - list max &lt;num&gt; amounts of lines (20 by default)"<br>    putquick "NOTICE $nickname :       resource - an absolute or relative path"<br>    putquick "NOTICE $nickname :              ie: /dev/null/*"<br>    putquick "NOTICE $nickname :       pattern  - a perl compatible regular expression (PCRE)"<br>    putquick "NOTICE $nickname :              ie: #channel2|user9|Cleanup or \[a-z\]\{7\}\\s\[0-9\]\{2\}"<br>    return<br>  }<br><br>  set resource [join [lindex [grep:clean $arguments] $offset]]<br>  set pattern [join [lrange $arguments [expr $offset + 1] end]]<br><br>  set count 0<br><br>  catch {[glob -- $resource]} error<br>  if {[regexp -nocase -- {no files matched glob pattern "(.*?)"} $error]} {<br>    puthelp "NOTICE $nickname :--- End of list - $count matches"<br>    return<br>  }<br><br>  foreach file "[glob -- $resource]" {<br>    if {[file isdirectory "$file"]} {continue}<br>    set fp [open $file r]<br>    while {![eof $fp]} {<br>      gets $fp line<br>      if {$count == $limit} {break}<br>      switch -regexp -- $option {<br>        {v} {<br>          if {[regexp -- {i} $option]} {<br>            catch {if {![regexp -nocase -- $pattern $line]} {puthelp "NOTICE $nickname :${file}:${line}" ; incr count}}<br>          } else {<br>            catch {if {![regexp -- $pattern $line]} {puthelp "NOTICE $nickname :${file}:${line}" ; incr count}}<br>          }<br>        }<br>        default {<br>          if {[regexp -- {i} $option]} {<br>            catch {if {[regexp -nocase -- $pattern $line]} {puthelp "NOTICE $nickname :${file}:${line}" ; incr count}}<br>          } else {<br>            catch {if {[regexp -- $pattern $line]} {puthelp "NOTICE $nickname :${file}:${line}" ; incr count}}<br>          }<br>        }<br>      }<br>    }<br>    close $fp<br>    if {$count == $limit} {<br>      puthelp "NOTICE $nickname :--- More than $limit hits, list truncated"<br>      break<br>    }<br>  }<br><br>  puthelp "NOTICE $nickname :--- End of list - $count matches"<br><br>}<br><br><br>proc grep:dcc {handle idx arguments} {<br><br>  set arguments [grep:clean $arguments]     ;# clean the arguments<br><br>  set offset    0                           ;# for optional parameters<br>  set  limit  500                           ;# the default output limit<br>  set option  [join [lindex $arguments 0]]  ;# first check<br><br>  if {[regexp -- {^-(\S+)$} [lindex $arguments 0] tmp option]} {<br>    if {[regexp -- {^([ivl]{1,3})$} $option]} {<br>      if {[regexp -- {l} $option]} {<br>        set offset 2<br>        regexp -- {^([0-9]+)$} [join [lindex $arguments 1]] tmp limit<br>      } else {<br>        set offset 1<br>      }<br>    } else {<br>      putidx $idx "unknown option \"$option\""<br>      return<br>    }<br>  }<br><br>  if {[llength $arguments] &lt; [expr $offset + 2]} {<br>    putidx $idx "Usage: grep \[-ivl num\] resource pattern"<br>    putidx $idx "       i        - ignore upper/lower case distinctions during comparisons"<br>    putidx $idx "       v        - invert the sense of matching, to select non-matching lines"<br>    putidx $idx "       l num    - list max &lt;num&gt; amounts of lines (20 by default)"<br>    putidx $idx "       resource - an absolute or relative path"<br>    putidx $idx "              ie: /dev/null/*"<br>    putidx $idx "       pattern  - a perl compatible regular expression (PCRE)"<br>    putidx $idx "              ie: #channel2|user9|Cleanup or \[a-z\]\{7\}\\s\[0-9\]\{2\}"<br>    return<br>  }<br><br>  putcmdlog "\$${handle}\$ $::lastbind $arguments"<br><br>  set resource [join [lindex [grep:clean $arguments] $offset]]<br>  set pattern [join [lrange $arguments [expr $offset + 1] end]]<br>  set count 0<br><br>  catch {[glob -- $resource]} error<br>  if {[regexp -nocase -- {no files matched glob pattern "(.*?)"} $error]} {<br>    putidx $idx "--- End of list - $count matches"<br>    return<br>  }<br><br>  foreach file "[glob -- $resource]" {<br>    if {[file isdirectory "$file"]} {continue}<br>    set fp [open $file r]<br>    while {![eof $fp]} {<br>      gets $fp line<br>      if {$count == $limit} {break}<br>      switch -regexp -- $option {<br>        {v} {<br>         if {[regexp -- {i} $option]} {<br>            catch {if {![regexp -nocase -- $pattern $line]} {putidx $idx "${file}:${line}" ; incr count}}<br>          } else {<br>            catch {if {![regexp -- $pattern $line]} {putidx $idx "${file}:${line}" ; incr count}}<br>          }<br>        }<br>        default {<br>          if {[regexp -- {i} $option]} {<br>            catch {if {[regexp -nocase -- $pattern $line]} {putidx $idx "${file}:${line}" ; incr count}}<br>          } else {<br>            catch {if {[regexp -- $pattern $line]} {putidx $idx "${file}:${line}" ; incr count}}<br>          }<br>        }<br>      }<br>    }<br>    close $fp<br>    if {$count == $limit} {<br>      putidx $idx "--- More than $limit hits, list truncated"<br>      break<br>   }<br>  }<br><br>  putidx $idx "--- End of list - $count matches"<br><br>}<br><br><br>proc grep:clean {i} {<br>  regsub -all -- \\\\ $i \\\\\\\\ i<br>  regsub -all -- \\\[ $i \\\\\[ i<br>  regsub -all -- \\\] $i \\\\\] i<br>  regsub -all -- \\\} $i \\\\\} i<br>  regsub -all -- \\\{ $i \\\\\{ i<br>  regsub -all -- \\\" $i \\\\\" i<br>  return $i<br>}<br><br>putlog "Script loaded: Grep TCL Port (C) 2004 perpleXa"</div></blockquote>This this script you refered but i've no idea how to change it to the one i need.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7174">honeybee</a> — Tue Sep 19, 2006 5:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2006-09-19T03:21:31-04:00</updated>

		<published>2006-09-19T03:21:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66436#p66436</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66436#p66436"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66436#p66436"><![CDATA[
download the grep script from the archive and modify it to work on tclsh rather than eggdrop.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Tue Sep 19, 2006 3:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-09-18T23:15:19-04:00</updated>

		<published>2006-09-18T23:15:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66432#p66432</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66432#p66432"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66432#p66432"><![CDATA[
These forums deal with eggdrop <span style="text-decoration:underline">only</span> related scripts.<br><br>The inference is any request deals with the Tool Command Language only (Tcl); for anything outside of these forums' main focus you will have to look elsewhere.<blockquote class="uncited"><div>... there is no guarantee of a response.</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon Sep 18, 2006 11:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[honeybee]]></name></author>
		<updated>2006-09-18T22:37:01-04:00</updated>

		<published>2006-09-18T22:37:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66431#p66431</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66431#p66431"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66431#p66431"><![CDATA[
as its a SCRIPT REQUEST, nowhere is mentioned it should be a TCL SCRIPT to be request another i thought we usualy deal in tcls so I dont mind if its a tcl script and i have made up my mind honey ;)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7174">honeybee</a> — Mon Sep 18, 2006 10:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-09-18T22:27:39-04:00</updated>

		<published>2006-09-18T22:27:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66430#p66430</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66430#p66430"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66430#p66430"><![CDATA[
<blockquote class="uncited"><div>i want a search tcl that will search ....</div></blockquote>Could you make your mind up? You either want a Tcl script or you don't. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon Sep 18, 2006 10:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[honeybee]]></name></author>
		<updated>2006-09-18T22:06:11-04:00</updated>

		<published>2006-09-18T22:06:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66428#p66428</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66428#p66428"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66428#p66428"><![CDATA[
btw, you can use non-eggdrop tcl commands too, but i dont mind if its a bash command aswell, just needed help so i asked you guys.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7174">honeybee</a> — Mon Sep 18, 2006 10:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-09-18T20:43:29-04:00</updated>

		<published>2006-09-18T20:43:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66426#p66426</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66426#p66426"/>
		<title type="html"><![CDATA[Re: file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66426#p66426"><![CDATA[
<blockquote class="uncited"><div>Hey guys<br>I need a non-eggdrop script that look into log files, I'm keeping 336 logs and previous year aswell, all text from channels, friends and college etc. just to keep the record for many stuff, i want a search tcl that will search for a masked word *De^KuS^* and give me the result. all help appreciated thanks.</div></blockquote>Non-eggdrop? Then this is the wrong place.<br><br>Learn about bash scripting maybe?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon Sep 18, 2006 8:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[honeybee]]></name></author>
		<updated>2006-09-18T19:23:35-04:00</updated>

		<published>2006-09-18T19:23:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66422#p66422</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66422#p66422"/>
		<title type="html"><![CDATA[file search.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66422#p66422"><![CDATA[
Hey guys<br>I need a non-eggdrop script that look into log files, I'm keeping 336 logs and previous year aswell, all text from channels, friends and college etc. just to keep the record for many stuff, i want a search tcl that will search for a masked word *De^KuS^* and give me the result. all help appreciated thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7174">honeybee</a> — Mon Sep 18, 2006 7:23 pm</p><hr />
]]></content>
	</entry>
	</feed>
