<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Wed Jun 19, 2013 7:54 pm by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Wed Jun 19, 2013 7:54 pm</pubDate>
  <lastBuildDate>Wed Jun 19, 2013 7:54 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96573#96573</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jan 25, 2011 3:36 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Suicidal software?  &lt;img src=&quot;images/smiles/icon_eek.gif&quot; alt=&quot;Shocked&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96573#96573</comments>
                                        <author>nelz</author>
                                        <pubDate>Tue Jan 25, 2011 3:36 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96573#96573</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96567#96567</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=64947'&gt;LeeNukes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jan 25, 2011 3:11 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Scratch this, it appears that after some time, it kills itself.  &lt;img src=&quot;images/smiles/icon_redface.gif&quot; alt=&quot;Embarassed&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96567#96567</comments>
                                        <author>LeeNukes</author>
                                        <pubDate>Tue Jan 25, 2011 3:11 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96567#96567</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96500#96500</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=64947'&gt;LeeNukes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Jan 24, 2011 9:54 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      it just sits there waiting for more input unless you kill it, even at the end of the file.&lt;br /&gt;
&lt;br /&gt;
The process is it loads its engine, then takes in the data, then when its finished, just sits there.&lt;br /&gt;
&lt;br /&gt;
I'll try and craft an end of the file, see if it works.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96500#96500</comments>
                                        <author>LeeNukes</author>
                                        <pubDate>Mon Jan 24, 2011 9:54 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96500#96500</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96483#96483</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Jan 23, 2011 6:55 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Is the problem that moses keeps waiting for more data from $scoringdir/$3.strue.$4 even when there is no more? If the program writing to that file closed it when it had finished, I would expect moses to exit as it would see an EOF.&lt;br /&gt;
&lt;br /&gt;
Or is the hangup elsewhere in the workflow?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96483#96483</comments>
                                        <author>nelz</author>
                                        <pubDate>Sun Jan 23, 2011 6:55 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96483#96483</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96474#96474</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=64947'&gt;LeeNukes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Jan 23, 2011 3:23 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;nelz wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;That depends on the program doing the reading. Do you have any control over that?&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
I have control over everything, this is the line for feeding in the data at which point I get caught in the program:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;# Translate scoring data using moses engine&lt;br /&gt;
/opt/moses/bin/moses -f $basedir/binarized/moses.ini &amp;lt; $scoringdir/$3.strue.$4 &amp;gt; $scoringdir/$3.mosesscore.$5&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
the -f is the config file for the particular engine, the $scoringdir/$3.strue.$4 is the input data and obviously the $scoringdir/$3.mosesscore.$5 is the output.&lt;br /&gt;
&lt;br /&gt;
Here is the help for the program: &lt;a href=&quot;http://www.leenukes.co.uk/documents/mosesinfo&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; class=&quot;postlink&quot;&gt;http://www.leenukes.co.uk/documents/mosesinfo&lt;/a&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96474#96474</comments>
                                        <author>LeeNukes</author>
                                        <pubDate>Sun Jan 23, 2011 3:23 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96474#96474</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96468#96468</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Jan 23, 2011 12:08 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      That depends on the program doing the reading. Do you have any control over that?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96468#96468</comments>
                                        <author>nelz</author>
                                        <pubDate>Sun Jan 23, 2011 12:08 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96468#96468</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96464#96464</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=64947'&gt;LeeNukes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Jan 22, 2011 11:35 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      The data can be added to I guess, just as long as it doesn't try to translate it.&lt;br /&gt;
&lt;br /&gt;
How would I append an end to it? Would it depend on the program supporting an EOF? Or can a ctrl+c be put in somehow?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96464#96464</comments>
                                        <author>LeeNukes</author>
                                        <pubDate>Sat Jan 22, 2011 11:35 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96464#96464</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96461#96461</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Jan 22, 2011 10:01 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Can you control the data it is fed, such as sending an EOF signal so the program knows there is no more data and it is time to exit.&lt;br /&gt;
&lt;br /&gt;
Otherwise, you'll need to run the program in the background and read data from its file as and when it appears, possibly with a while read loop.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96461#96461</comments>
                                        <author>nelz</author>
                                        <pubDate>Sat Jan 22, 2011 10:01 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96461#96461</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96445#96445</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=64947'&gt;LeeNukes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Jan 22, 2011 2:43 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      The program by default writes to STDOUT but I'm redirecting it into a file.&lt;br /&gt;
&lt;br /&gt;
Its essentially translation software, so it will take in the strings in one language and out put them to another.&lt;br /&gt;
&lt;br /&gt;
It's a service though, so once its processed the file, it sits there. Waiting for input from STDIN.&lt;br /&gt;
&lt;br /&gt;
As it waits for input from STDIN I don't think the loop method will work as it won't ever be &amp;quot;done&amp;quot;.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96445#96445</comments>
                                        <author>LeeNukes</author>
                                        <pubDate>Sat Jan 22, 2011 2:43 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96445#96445</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96433#96433</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Jan 21, 2011 11:19 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Could you make the file it writes to a FIFO? Then your script can read the data as it is being written.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96433#96433</comments>
                                        <author>nelz</author>
                                        <pubDate>Fri Jan 21, 2011 11:19 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96433#96433</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96429#96429</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=2793'&gt;MartyBartfast&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Jan 21, 2011 10:30 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      You could put the program into the background, and then loop round waiting for it to complete, checking it's status with jobs e.g:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
$ sleep 60s &amp;amp;&lt;br /&gt;
&amp;#91;1&amp;#93; 18685&lt;br /&gt;
$ jobs -l&amp;nbsp; &amp;nbsp; &amp;nbsp;# do this in a timed loop&lt;br /&gt;
&amp;#91;1&amp;#93;+ 18685 Running&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sleep 60s &amp;amp;&amp;nbsp; &lt;br /&gt;
$ jobs -l&lt;br /&gt;
&amp;#91;1&amp;#93;+ 18685 Running&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sleep 60s &amp;amp;&lt;br /&gt;
$ jobs -l&lt;br /&gt;
&amp;#91;1&amp;#93;+ 18685 Running&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sleep 60s &amp;amp;&lt;br /&gt;
$ jobs -l&lt;br /&gt;
&amp;#91;1&amp;#93;+ 18685 Running&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sleep 60s &amp;amp;&lt;br /&gt;
$ jobs -l&lt;br /&gt;
&amp;#91;1&amp;#93;+ 18685 Done&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sleep 60s&lt;br /&gt;
$&amp;nbsp; # now go on and do the next bit&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96429#96429</comments>
                                        <author>MartyBartfast</author>
                                        <pubDate>Fri Jan 21, 2011 10:30 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96429#96429</guid>
                                      </item>
                                      <item>
                                        <title>Script Suggestions</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=96427#96427</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=64947'&gt;LeeNukes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Jan 21, 2011 10:10 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi guys,&lt;br /&gt;
&lt;br /&gt;
Written several bash scripts to run through a process, stuck on one due to it launching a program which it becomes stuck in.&lt;br /&gt;
&lt;br /&gt;
Essentially the program runs, outputs strings into a file, once those strings have ran through, another program needs to be ran which then compares the strings which ran through a program with the strings which are in another file.&lt;br /&gt;
&lt;br /&gt;
It won't skip to the next step unless the program is quit, normally Ctrl+C will do this as normal.&lt;br /&gt;
&lt;br /&gt;
There is no real set time at how long the program takes, anything from 10 minutes to 30 minutes probably, but ideally I want the next step to run straight after the program finishes.&lt;br /&gt;
&lt;br /&gt;
I was thinking of something with wc maybe? To compare the two files line counts, but how do I get a wc going whilst its running the program?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=96427#96427</comments>
                                        <author>LeeNukes</author>
                                        <pubDate>Fri Jan 21, 2011 10:10 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=96427#96427</guid>
                                      </item></channel></rss>