bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I thought >&- and > /dev/null were almost the same


From: Paul Jarc
Subject: Re: I thought >&- and > /dev/null were almost the same
Date: Sat, 24 Nov 2001 20:45:59 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu)

Dan Jacobson <address@hidden> wrote:
> $ date > /dev/null
> $ date >&-
> Date: Fri Dec 31 18:59:38 1999 -0500
> $ echo o >&-
> $ uname -a
> Linux localhost.localdomain 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i586 
> unknown

Try this:
bash -c 'ls -l /proc/$$/fd >&2' >&-
If it shows an open descriptor "1", then there's a bash bug.  If not,
then the date command is noticing that descriptor 1 is closed and
writing to another descriptor instead.

> And how do you explain echo's okness?

I'd guess that bash is correct, and that date is trying too hard to
protect you from yourself.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]