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

	<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>2009-12-07T16:45:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-12-07T16:43:53-04:00</updated>

		<published>2009-12-07T16:43:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91235#p91235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91235#p91235"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91235#p91235"><![CDATA[
well I dont think Im going to see the garbage my eggy spews out since Im not logged on to the same terminal window all the time :&gt;<br><br>but thanks so far, Im going to try that next time <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Mon Dec 07, 2009 4:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-12-07T16:26:15-04:00</updated>

		<published>2009-12-07T16:26:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91234#p91234</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91234#p91234"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91234#p91234"><![CDATA[
Yup,<br>Since your eggie runs in the background, you'll probably want to redirect stdout and stderr to /dev/null to avoid garbage being spewed out to the terminal where you started your eggie, but &amp; is enough to make the exec-call "non-blocking".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Dec 07, 2009 4:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-12-07T16:24:08-04:00</updated>

		<published>2009-12-07T16:24:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91233#p91233</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91233#p91233"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91233#p91233"><![CDATA[
oh, oh?<br>exec $myshellscript &amp;<br>is going to do the trick and ill never have a non-responding bot again when calling something that takes a hell of a time via exec?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Mon Dec 07, 2009 4:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-12-07T16:06:49-04:00</updated>

		<published>2009-12-07T16:06:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91232#p91232</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91232#p91232"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91232#p91232"><![CDATA[
Not quite, that would launch the script and redirect the stdout of the script to /dev/null. It would, however, still block while the script is running. The key part is this (quoted from the manpage):<blockquote class="uncited"><div>If  the last arg is ''&amp;'' then the pipeline will be executed in background. In this case the exec command will return a list whose elements are the process identifiers for all of the subprocesses in the pipeline. The standard output from the last command in the pipeline will go to the application's standard output if it hasn't been redirected, and error output from all of the commands in the pipeline will go to the application's standard error file unless redirected.</div></blockquote>So, what you need to do is suffix the commandline with a &amp;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Dec 07, 2009 4:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-12-07T16:02:01-04:00</updated>

		<published>2009-12-07T16:02:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91231#p91231</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91231#p91231"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91231#p91231"><![CDATA[
uhm, I think im fine with a so called "fire and forget" solution, although Im not sure which solution you are suggesting now oO<br><br>so exec $shellscript <strong class="text-strong">&gt;/dev/null</strong> is meant to do the trick, launch the script into bg and NOT block the remaining code?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Mon Dec 07, 2009 4:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-12-07T14:59:08-04:00</updated>

		<published>2009-12-07T14:59:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91229#p91229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91229#p91229"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91229#p91229"><![CDATA[
Whether to use exec or open pretty much comes down to whether you need to maintain contact with the shell script (send text to it, read it's output, know if it's still running or not), or simply a "fire and forget" script...<br><br>If you don't care for what the script is doing or when it's completed, exec should do the trick. See the manpage for a list of possible pipe controls (&amp;, |, etc).<br><br>If, however, you need to keep track of the script while it's running, you'll need to use open. As for reading the generated output, you'd probably use fileevents for this. I'd also recommend setting the file channel into non-blocking mode. There's a few good examples how to get all this working on the forum, but feel free to ask if you need further assistance with it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Dec 07, 2009 2:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dj-zath]]></name></author>
		<updated>2009-12-07T12:07:30-04:00</updated>

		<published>2009-12-07T12:07:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91227#p91227</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91227#p91227"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91227#p91227"><![CDATA[
Hi there<br><br>sure its possable!<br><br>I do it all the time <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>heres an example:<br><div class="codebox"><p>Code: </p><pre><code>catch {exec ./Pisg -co Pisg.cfg &gt;/dev/null &amp;};</code></pre></div>heres one  where I insert an some varables<br><div class="codebox"><p>Code: </p><pre><code>exec ./fetch -q -A -m -T 1 -o /dev/null "http://$RacIP:$RacPort/x/playing.cgi?c=$command" &gt;&amp; /dev/null};</code></pre></div>let me know if this helps.<br><br>-DjZ-<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10318">dj-zath</a> — Mon Dec 07, 2009 12:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-12-07T16:45:28-04:00</updated>

		<published>2009-12-07T06:51:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=91226#p91226</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=91226#p91226"/>
		<title type="html"><![CDATA[[SOLVED] exec in bg]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=91226#p91226"><![CDATA[
hey guys (and girls ^^)<br><br>looking for a solution to kind of call a shell script (.sh) which takes about 3 minutes to be finished into background without getting my eggdrop stuck and not responding at all.<br><br>fact is: its not possible to do it with exec since exec waits for a reply<br>possible solution: using something like set x [open "| myscript.sh"]?<br><br>do I also need a set x2 [read $x] or what else is needed to make it work, do I miss something in general anyway?<br><br>thx for all your help <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Mon Dec 07, 2009 6:51 am</p><hr />
]]></content>
	</entry>
	</feed>
