<?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/5031" />

	<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>2003-07-24T21:01:04-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-07-24T21:01:04-04:00</updated>

		<published>2003-07-24T21:01:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23931#p23931</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23931#p23931"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23931#p23931"><![CDATA[
bind pub - !emerge msg_who<br><br>proc msg_who {nick uhost hand channel arg} {<br><br><br>        putlog "EMERGE request from $nick has been receved!"<br>        #uncomment the next line if you want only the first in $arg word to be in the search<br>        set arg [lindex [split $arg] 0]<br>        if { [catch {set msg [exec /usr/bin/emerge -s $arg |grep "*" ]} ]} {<br>                putserv "PRIVMSG $channel :Nothing Matched Your Search."<br>        } else {<br>                putserv "PRIVMSG $channel :Results Are As Follows."<br>                set msg [split $msg "\n"]<br>                foreach line $msg { putserv "PRIVMSG $channel :$line" }<br>                putserv "PRIVMSG $channel :End Of Search."<br>        }<br>        return 0<br>}<br><br><br><br><br><br><br>ok...thats the exact code i am using. But it still doesn't work. It just spins my drive. and i have to "kill -9" the process it's trying to use. Are you allowed to put other commands after "$arg"? like  exec /usr/bin/emerge -s $arg |grep "*" . or doea $arg have to end it? cause it doesn't seem to work. when i do the same search from the command line using "emerge -s karamba |grep "*" i get .<br><br>dilema@pimpzter dilema $ emerge -s karamba |grep "*"<br>*  x11-misc/karamba<br>*  x11-misc/superkaramba<br>*  x11-plugins/karamba-agenda<br>*  x11-plugins/karamba-albums<br>blah blah blah.<br><br>where of course $arg would be the string "karamba". i don't know whats going on here and why it spins my drive so much but yet when i do it manually it works fine. is it a problem with the "$arg"? and i know it's not perm issues btw it never come sup with any searchs when the bot does it. it just spins and spins. weird ain't it or a simple mistake.<p>Statistics: Posted by Guest — Thu Jul 24, 2003 9:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-07-24T05:03:00-04:00</updated>

		<published>2003-07-24T05:03:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23885#p23885</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23885#p23885"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23885#p23885"><![CDATA[
I know, just wanted to push him in the right direction <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><blockquote class="uncited"><div>secirity isn't my concern at his point as you prolly guessed</div></blockquote>I think that meant security <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Thu Jul 24, 2003 5:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-07-24T04:47:05-04:00</updated>

		<published>2003-07-24T04:47:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23884#p23884</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23884#p23884"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23884#p23884"><![CDATA[
Not a very wise idea at all when using the exec command.<br><br>This will allow complete control of the shell, via your new command.<br><br>You would at least need to perform some syntax checking on the $arg variable before passing it to the exec command, even then, be very vary.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Jul 24, 2003 4:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-07-24T03:59:37-04:00</updated>

		<published>2003-07-24T03:59:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23878#p23878</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23878#p23878"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23878#p23878"><![CDATA[
change this:<div class="codebox"><p>Code: </p><pre><code>proc msg_who {nick uhost hand channel args} {</code></pre></div>to this<div class="codebox"><p>Code: </p><pre><code>proc msg_who {nick uhost hand channel arg} {</code></pre></div>then everything typed after !emerge will be in $arg<div class="codebox"><p>Code: </p><pre><code>#uncomment the next line if you want only the first in $arg word to be in the search#set arg [lindex [split $arg] 0]set msg [exec -- emerge -s $arg |egrep "*|available|Size" ]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Thu Jul 24, 2003 3:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-07-23T19:17:05-04:00</updated>

		<published>2003-07-23T19:17:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23871#p23871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23871#p23871"/>
		<title type="html"><![CDATA[thanks guys!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23871#p23871"><![CDATA[
set msg [exec -- emerge -s |egrep "*|available|Size" ] <br><br>well yeah it needed a space and not too mention you can remove the "--" but it doesn't really matter. andwho. the problem is getting it to use the !emerge "blah" how does it know what to search for. i mean where "blah" is gonna be placed behind the -s in the syntax "emerge -s blah"<br>so thats the real problem. secirity isn't my concern at his point as you prolly guessed. thats the real issue. is getting it to read the !emerge "blah" . I just need some advie on how to get it to read after the !emerge and search for whatever string that the user puts in there. getting it to work is the forst process.. thanks for th replays and sorry i didn't reply fast enough i was away. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Wed Jul 23, 2003 7:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-21T20:17:43-04:00</updated>

		<published>2003-07-21T20:17:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23769#p23769</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23769#p23769"/>
		<title type="html"><![CDATA[Re: just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23769#p23769"><![CDATA[
<blockquote class="uncited"><div>bind pub - !emerge msg_who<br>...<br>set msg [exec -- emerge -s |egrep "*|available|Size"]</div></blockquote>Since it is a pub bind, the last argument passed to the proc is a string containing the arguments (if any). Using the variable name "args" (like you do), which has a special meaning in tcl, just leads to extra work in this case, so change that to something else.<br><br>I don't know the syntax of "emerge", but I bet the search string goes after the -s <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>The only problem left now is escaping the user input to avoid security issues. Right now I see 3 options:<br><br>a) Since you're probably not going to search for things containing any of the "dangerous" chars anyway, I suggest a polite message in return to users trying a search containing any of the banned chars.<br><br>b) Escaping the chars. (Can lead to unexpected results, so you better test it real good before you make the command publicly avaliable if you go for this option.)<br><br>c) Filtering them out and then doing the search. (makes no sense, but I know some people that would like it to be that way (before realizing it's a bad idea when they see it in action <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">))<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Jul 21, 2003 8:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-21T11:10:12-04:00</updated>

		<published>2003-07-21T11:10:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23750#p23750</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23750#p23750"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23750#p23750"><![CDATA[
According to the exec command the "--" should be removed. Consult the <a href="http://tcl.activestate.com/man/tcl8.2.3/TclCmd/exec.htm" class="postlink">online</a> manual.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jul 21, 2003 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-07-21T02:25:26-04:00</updated>

		<published>2003-07-21T02:25:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23732#p23732</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23732#p23732"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23732#p23732"><![CDATA[
<blockquote class="uncited"><div>if { [catch {set msg [exec -- emerge -s |egrep "*|available|Size" ]} ]}</div></blockquote>this line is messed up I think, I'm not sure <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"> .<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Jul 21, 2003 2:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-07-20T19:00:33-04:00</updated>

		<published>2003-07-20T19:00:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23726#p23726</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23726#p23726"/>
		<title type="html"><![CDATA[just some quick help please? for the gentoo community :)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23726#p23726"><![CDATA[
Ok, I am writing a script that will search Gentoo portage. But i don't quite understand TCL all that great. heres what i have so far.<br><br><br>bind pub - !emerge msg_who<br><br>proc msg_who {nick uhost hand channel args} {<br><br><br>putlog "WHO request from $nick has been receved!"<br>if { [catch {set msg [exec -- emerge -s |egrep "*|available|Size" ]} ]} {<br>    putserv "PRIVMSG $channel :Nothing Matched Your Search"<br>} else {<br>                putserv "PRIVMSG $channel :Search results are as follows."<br>        set msg [split $msg "\n"]<br>        foreach line $msg { putserv "PRIVMSG $channel :$line" }<br>        putserv "PRIVMSG $channel :Search Finished."<br>}<br>return 0<br>}<br><br><br>Now thats all fine and dandy (it doesn't work i know) but i want it to be able use "!emerge xmms" for eample and PM the user who did the command, and show him all the results. or add something to where i can change it to either send it to the channel or the person. this way i have the option. the problem is i don't uderstand how to use arguements. cause if you do "!emerge xmms" and then someone does "!emerge mozilla" hows it know what to search for? thats where the arguemtn comes in to play. Anyway any help with this would be great thanks in advance. my email is <a href="mailto:dilema@phreaker.net">dilema@phreaker.net</a> or you can find me on irc.freenode.net in the channel #w00t tryin to get this script to come to life...thanks again <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 Guest — Sun Jul 20, 2003 7:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
