Re: bug or undocumented feature

2009-08-25 Thread mitch
On Aug 22, 11:17 am, Jan Schampera  wrote:
> Mitch Frazier wrote:
> > The close appears to be a special case of (from the man page):
>
> >> Similarly, the redirection operator
>
> >>       [n]>&digit-
>
> >> moves the file descriptor digit to file descriptor n,
> >> or the standard output (file descriptor 1) if n is not
> >> specified.
>
> > Not sure if that's a bug or a feature but it should be a feature and
> > probably should be documented.
>
> It's not a bug. It's not undocumented per se, it's in the description of
> the corresponding input duplication mechanism. It applies to both
> duplication methods.
>
> Jan

Yep, I see that now.  I should RTFM :)


bug or undocumented feature

2009-08-22 Thread Mitch Frazier

Someone just pointed out to me at the link below that you can close open
files in bash using "n>&-", for example:

   exec 7&-  # Close fd 7

The close appears to be a special case of (from the man page):

> Similarly, the redirection operator
> 
>   [n]>&digit-
> 
> moves the file descriptor digit to file descriptor n,
> or the standard output (file descriptor 1) if n is not
> specified.

Not sure if that's a bug or a feature but it should be a feature and
probably should be documented.

Link: http://www.linuxjournal.com/node/1008709