Update: Moved hedges from comments to here to aid in reading. This set of comments is entirely from my memory of *nix variants I have used and working through similar problems. There may be other / newer versions of *nix and ps that differ from my memory.

PS does not display the part of the command line after a pipe or redirect symbol, because it is not a part of the process - it is only a method of setting up the file descriptors in whatever program is calling the programs. The information after the redirection or pipe is another process or file, and would not be stored or shown in the process table.

The command foo | bar > biz would be parsed so that foo's STDOUT would be hooked up to bar's STDIN, and bar's STDOUT would be attached to the file handle attached to the file biz. Two different processes. Unless the shell (the one spawning the foo | ... commands) rewrites its $0 to reflect what is currently being written (which may be the case), the entire tubing between programs is not displayed using the ps command.

Now, that being said, I would like to be proven wrong, because there are a number of instances where that would be quite useful. :-)

--MidLifeXis


In reply to Re^2: How to know STDOUT associated with a process pid by MidLifeXis
in thread How to know STDOUT associated with a process pid by bgupta

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.