If all you have is the end of a pipe - it is hard to say what is on the other side. You could try and fish around in /proc/$$/fd . You could look at the 1 and 2 files to see if they are to the same thing.
paul@paul-laptop:~/$ perl -e 'print "Pid: $$\n"; print `ls -l /proc/$$ +/fd`' Pid: 391 total 8 lrwx------ 1 paul paul 64 2007-03-06 09:34 0 -> /dev/pts/1 lrwx------ 1 paul paul 64 2007-03-06 09:34 1 -> /dev/pts/1 lrwx------ 1 paul paul 64 2007-03-06 09:34 2 -> /dev/pts/1 lr-x------ 1 paul paul 64 2007-03-06 09:34 3 -> pipe:[162460] l-wx------ 1 paul paul 64 2007-03-06 09:34 4 -> pipe:[162460] lr-x------ 1 paul paul 64 2007-03-06 09:34 5 -> pipe:[162461] lr-x------ 1 paul paul 64 2007-03-06 09:34 6 -> inotify l-wx------ 1 paul paul 64 2007-03-06 09:34 7 -> pipe:[162461] paul@paul-laptop:~/$ perl -e 'print "Pid: $$\n"; print `ls -l /proc/$$ +/fd`' 2>&1 Pid: 393 total 5 lrwx------ 1 paul paul 64 2007-03-06 09:34 0 -> /dev/pts/1 lrwx------ 1 paul paul 64 2007-03-06 09:34 1 -> /dev/pts/1 lrwx------ 1 paul paul 64 2007-03-06 09:34 2 -> /dev/pts/1 lr-x------ 1 paul paul 64 2007-03-06 09:34 3 -> pipe:[162483] lr-x------ 1 paul paul 64 2007-03-06 09:34 6 -> inotify paul@paul-laptop:~/$ perl -e 'print "Pid: $$\n"; print `ls -l /proc/$$ +/fd`' 2>/dev/null Pid: 395 total 8 lrwx------ 1 paul paul 64 2007-03-06 09:34 0 -> /dev/pts/1 lrwx------ 1 paul paul 64 2007-03-06 09:34 1 -> /dev/pts/1 l-wx------ 1 paul paul 64 2007-03-06 09:34 2 -> /dev/null lr-x------ 1 paul paul 64 2007-03-06 09:34 3 -> pipe:[162501] l-wx------ 1 paul paul 64 2007-03-06 09:34 4 -> pipe:[162501] lr-x------ 1 paul paul 64 2007-03-06 09:34 5 -> pipe:[162502] lr-x------ 1 paul paul 64 2007-03-06 09:34 6 -> inotify l-wx------ 1 paul paul 64 2007-03-06 09:34 7 -> pipe:[162502]


my @a=qw(random brilliant braindead); print $a[rand(@a)];

In reply to Re: if (STDERR == STDOUT) by Rhandom
in thread if (STDERR == STDOUT) by freja

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.