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

	<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>2007-10-26T19:18:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-10-26T19:18:46-04:00</updated>

		<published>2007-10-26T19:18:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77167#p77167</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77167#p77167"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77167#p77167"><![CDATA[
Scripts that run exec, especially with unchecked input, are dangerous. Something to keep in mind when writing this script.<br><a href="http://forum.egghelp.org/viewtopic.php?t=9945" class="postlink">Script security</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Oct 26, 2007 7:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-26T17:31:31-04:00</updated>

		<published>2007-10-26T17:31:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77165#p77165</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77165#p77165"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77165#p77165"><![CDATA[
Try something like this then:<div class="codebox"><p>Code: </p><pre><code>if {[catch {exec who} status]} {#error condition, error-message stored in $status} {#Successful, any output stored in $status}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Oct 26, 2007 5:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BeBoo]]></name></author>
		<updated>2007-10-26T15:11:24-04:00</updated>

		<published>2007-10-26T15:11:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77163#p77163</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77163#p77163"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77163#p77163"><![CDATA[
Thanks. I've made that change.<br><br>One other question... If I were to run a command such as 'who' by !exec who (which is not allowed on the shell), it outputs the "Permission denied" as a TCL error in the PL... Is there a way to detect if it's an error of some sort and have it output it to the channel anyway?<br><br>Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9337">BeBoo</a> — Fri Oct 26, 2007 3:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-26T14:46:14-04:00</updated>

		<published>2007-10-26T14:46:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77162#p77162</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77162#p77162"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77162#p77162"><![CDATA[
So?<br>Still only gets passed to the proc as a single parameter... Hence you get the whole commandline when doing [lindex $args 0].<br><br>in fact, you'd get the same result if you'd replace "args" with "text", and "[lindex $args 0]" with "$text" in your script<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Oct 26, 2007 2:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BeBoo]]></name></author>
		<updated>2007-10-26T14:37:58-04:00</updated>

		<published>2007-10-26T14:37:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77161#p77161</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77161#p77161"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77161#p77161"><![CDATA[
Because I call the commands I want to be exec'd... for instance:<br><br>!exec ps -u<br>or<br>!exec uptime<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9337">BeBoo</a> — Fri Oct 26, 2007 2:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-26T14:27:22-04:00</updated>

		<published>2007-10-26T14:27:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77160#p77160</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77160#p77160"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77160#p77160"><![CDATA[
Then, pardon me for asking, what use would you have of using "args"?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Oct 26, 2007 2:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BeBoo]]></name></author>
		<updated>2007-10-26T14:26:01-04:00</updated>

		<published>2007-10-26T14:26:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77159#p77159</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77159#p77159"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77159#p77159"><![CDATA[
Just one binding: !exec<br><br>I will post my script so it can be critiqued when I'm done cleaning it up.<br><br>heh<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9337">BeBoo</a> — Fri Oct 26, 2007 2:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-26T14:19:11-04:00</updated>

		<published>2007-10-26T14:19:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77158#p77158</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77158#p77158"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77158#p77158"><![CDATA[
So you use several different types of bindings to trigger that proc?<br><br>Ah well, newlines would generally be \n yes, possibly except on "odd" (windows) platforms...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Oct 26, 2007 2:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BeBoo]]></name></author>
		<updated>2007-10-26T14:16:56-04:00</updated>

		<published>2007-10-26T14:16:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77157#p77157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77157#p77157"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77157#p77157"><![CDATA[
I am using it's feature... It's in my proc... proc runit {nick uhost handle chan args} {<br><br>That works great! Now, because the commands that I will run, most of them are multi-lined and would like all the lines to appear in the output. How would I determine the end of the line? Would it be \n?<br><br>Thanks!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9337">BeBoo</a> — Fri Oct 26, 2007 2:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-10-26T14:05:41-04:00</updated>

		<published>2007-10-26T14:05:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77156#p77156</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77156#p77156"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77156#p77156"><![CDATA[
First off, try to avoid using the name "args" for any variable, unless explicitly intended to use it's special feature.<br>Secondly, you'll have to separate the arguments from the command in the cmd-line string, and pass them as a separate argument to exec.<br><br>A simple example:<div class="codebox"><p>Code: </p><pre><code>proc docommand {cmdline} { set _t [split $cmdline " "] return [exec -- [lindex $_t 0] [join [lrange $_t 1 end] " "]]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Oct 26, 2007 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BeBoo]]></name></author>
		<updated>2007-10-26T13:51:13-04:00</updated>

		<published>2007-10-26T13:51:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77154#p77154</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77154#p77154"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77154#p77154"><![CDATA[
Without what quotes? I typed: !exec ps -u (with no quotes)<br><br>I get the following with the .tcl command in PL:<div class="codebox"><p>Code: </p><pre><code>1:48pm (BeBoo) .tcl exec ps -ux1:48pm (optix) What? You need '.help'</code></pre></div>The thing is, I'd like the output to go to the chan... Logging into my eggie just to run a command is just as bad as logging into the shell... I'd rather just be able to type "!exec ps -ux"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9337">BeBoo</a> — Fri Oct 26, 2007 1:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2007-10-26T13:47:32-04:00</updated>

		<published>2007-10-26T13:47:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77153#p77153</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77153#p77153"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77153#p77153"><![CDATA[
without the quotes?<br>I've tried in PL: .tcl exec ps -ux<br><br>It works, making a lot off errors because it tries to execute the output.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Oct 26, 2007 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BeBoo]]></name></author>
		<updated>2007-10-26T13:40:44-04:00</updated>

		<published>2007-10-26T13:40:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=77152#p77152</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=77152#p77152"/>
		<title type="html"><![CDATA[Exec issue...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=77152#p77152"><![CDATA[
Hey everyone. I am making a simple exec tcl script that only I can run with my eggie that will do little commands on my shell for me instead of logging into it to do a simple task. Anyway, my problem is, I can get it to run single word commands such as "uptime" and "pwd" but i can't get it to do anything that has a switch needed such as "ps -x". I get the following error:<br><div class="codebox"><p>Code: </p><pre><code>Tcl error [techjoose::runit]: couldn't execute "ps -x": no such file or directory</code></pre></div>Any ideas on how this could work? My script is quite simple and basic:<br><div class="codebox"><p>Code: </p><pre><code>putserv "PRIVMSG $chan :\002\00305\[\003 \00312EXECUTOR\003 \00305\]\002\003 [exec [lindex $args 0]]"</code></pre></div>Thanks for any help anyone can offer!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9337">BeBoo</a> — Fri Oct 26, 2007 1:40 pm</p><hr />
]]></content>
	</entry>
	</feed>
