intercept stdout/stderr of another process or disowned process

2010-11-23 194 words 1 min read

The command is definately going to save your day if you have disowned the process by mistake. Only uses strace so might as well work on Solaris also, though not tried it.

intercept stdout/stderr of another process or disowned process

  <td>
    <div class="text codecolorer">
      strace -e write=1,2 -p $PID 2>&1 | sed -un "/^ |/p" | sed -ue "s/^.{9 }(.{50}).+/1/g" -e 's/ //g' | xxd -r -p
    </div>
  </td>
</tr>
1

Useful to recover a output(stdout and stderr) “disown”ed or “nohup“ep process of other instance of ssh.

With the others options the stdout / stderr is intercepted, but only the first n chars.

This way we can recover ALL text of stdout or stderr

* View this command to comment, vote or add to favourites * View all commands by glaudiston

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/1SBr9I6EHUM/intercept-stdoutstderr-of-another-process-or-disowned-process

Enhanced by Zemanta

author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it