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: Chet Ramey
Subject: Re: I thought >&- and > /dev/null were almost the same
Date: Mon, 26 Nov 2001 09:45:53 -0500

> > $ date > /dev/null
> > $ date >&-
> > date: write error: Bad file descriptor
> 
> These are not the same thing.  The first provides `date' a valid file
> descriptor 0 that is opened on /dev/null.  The second closes file descriptor 
> 0.

Whoops, my fault.  It's file descriptor 1.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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