On 2010-01-15, I?aki Baz Castillo <ibc / aliax.net> wrote:
> Hi, how could I know if $stderr has been redirected to /dev/null?

You couldn't.

Consider a wrapper:

	exec 5>/dev/null
	ruby foo.rb 2>&5

Or for that matter, a file "/home/ibc/nulldev" which happens to be
a character special device using the same driver as /dev/null.

... Note that this assumes that what you care about is "$stderr is
being thrown away", not the exact path by which it's being done.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam / seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!