<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=3096&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / pgrep: unexpected return code in non-interactive script [SOLVED]]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=3096</link>
		<description><![CDATA[The most recent posts in pgrep: unexpected return code in non-interactive script [SOLVED].]]></description>
		<lastBuildDate>Tue, 15 Oct 2019 13:45:31 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: pgrep: unexpected return code in non-interactive script [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=18234#p18234</link>
			<description><![CDATA[<p>I dont know much about pgrep but looking at the man page the flag -x might be warranted??</p><div class="codebox"><pre><code>-x, --exact
              Only match processes whose names (or command line if  -f  is  speci‐
              fied) exactly match the pattern.</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (HevyDevy)]]></author>
			<pubDate>Tue, 15 Oct 2019 13:45:31 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=18234#p18234</guid>
		</item>
		<item>
			<title><![CDATA[Re: pgrep: unexpected return code in non-interactive script [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=18233#p18233</link>
			<description><![CDATA[<p>I redirected the script&#039;s stderr to a log to investigate what&#039;s going on when <span class="bbc">pgrep -f &#039;regex&#039; &amp;&amp; foo</span> fails to work as expected.</p><p>Lo and behold, a bunch of &quot;pgrep: write error&quot; entries show up in the log.</p><p>So it seems the issue here is that when a shell script runs in the background, pgrep gets grumpy unless its stdout is redirected somewhere (even if only to /dev/null).</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Tue, 15 Oct 2019 12:30:36 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=18233#p18233</guid>
		</item>
		<item>
			<title><![CDATA[pgrep: unexpected return code in non-interactive script [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=18177#p18177</link>
			<description><![CDATA[<p>In a non-interactive shell script, <em>command</em> in <span class="bbc">pgrep -f &#039;regex&#039; &amp;&amp; command</span> never runs when expected.</p><p>However, <em>command</em> in <span class="bbc">pgrep -f &#039;regex&#039; &gt;/dev/null &amp;&amp; command</span> does run when expected.</p><p>One of the scripts I use daily is affected by this (on line 27):<br /><a href="https://github.com/bdantas/wifi-monitor/blob/master/wifi-monitor" rel="nofollow">https://github.com/bdantas/wifi-monitor … fi-monitor</a></p><p>The function icon_add is supposed to return immediately (without creating an icon) if an icon already exists. If I remove <span class="bbc">&gt;/dev/null</span> from line 27, however, the function never returns and icons pile up in the systray.</p><p>Any idea why <span class="bbc">&gt;/dev/null</span> is required here? I thought the exit code of a utility (pgrep in this case) should be the same regardless of where its output is going.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Tue, 08 Oct 2019 11:38:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=18177#p18177</guid>
		</item>
	</channel>
</rss>
