<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>MacOS on Amit Agarwal Linux Blog</title>
    <link>/tags/macos/</link>
    <description>Recent content in MacOS on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 23 Nov 2010 12:51:27 +0000</lastBuildDate>
    
	<atom:link href="/tags/macos/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>intercept stdout/stderr of another process or disowned process</title>
      <link>/2010/11/23/intercept-stdoutstderr-process-disowned-process/</link>
      <pubDate>Tue, 23 Nov 2010 12:51:27 +0000</pubDate>
      
      <guid>/2010/11/23/intercept-stdoutstderr-process-disowned-process/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;The command is definately going to save your day if you have &lt;a class=&#34;zem_slink&#34; title=&#34;Disownment&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Disownment&#34;&gt;disowned&lt;/a&gt; the process by mistake. Only uses &lt;a class=&#34;zem_slink&#34; title=&#34;Strace&#34; rel=&#34;homepage&#34; href=&#34;http://sourceforge.net/projects/strace/&#34;&gt;strace&lt;/a&gt; so might as &lt;a class=&#34;zem_slink&#34; title=&#34;Well intervention&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Well_intervention&#34;&gt;well work&lt;/a&gt; on &lt;a class=&#34;zem_slink&#34; title=&#34;Solaris (operating system)&#34; rel=&#34;homepage&#34; href=&#34;http://oracle.com/solaris&#34;&gt;Solaris&lt;/a&gt; also, though not tried it.&lt;/p&gt;
&lt;p&gt;intercept stdout/&lt;a class=&#34;zem_slink&#34; title=&#34;Standard streams&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Standard_streams&#34;&gt;stderr&lt;/a&gt; of another process or disowned process&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      strace -e write=1,2 -p $PID 2&amp;gt;&amp;amp;1 | sed -un &amp;quot;/^ |/p&amp;quot; | sed -ue &amp;quot;s/^.{9 }(.{50}).+/1/g&amp;quot; -e &#39;s/ //g&#39; | xxd -r -p
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Useful to recover a output(stdout and stderr) “disown”ed or “&lt;a class=&#34;zem_slink&#34; title=&#34;Nohup&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Nohup&#34;&gt;nohup&lt;/a&gt;“ep process of other instance of ssh.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
