[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug or undocumented feature
From: |
Mitch Frazier |
Subject: |
bug or undocumented feature |
Date: |
Fri, 21 Aug 2009 18:40:15 -0700 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
Someone just pointed out to me at the link below that you can close open
files in bash using "n>&-", for example:
exec 7<file # Open file on fd 7
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
- bug or undocumented feature,
Mitch Frazier <=