Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: if (STDERR == STDOUT)

by Rhandom (Curate)
on Mar 06, 2007 at 16:36 UTC ( [id://603453]=note: print w/replies, xml ) Need Help??


in reply to if (STDERR == STDOUT)

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)];

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://603453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found