On Sat, 23 Mar 2013 10:44:59 -0700 Alec Warner <[email protected]> wrote:
> On Sat, Mar 23, 2013 at 9:26 AM, Michał Górny <[email protected]> wrote: > > + if [[ ${lock_fd} ]]; then > > + # Close the lock file when we are done with it. > > + # Prevents deadlock if we aren't in a subshell. > > + eval "exec ${lock_fd}>&-" > > Not following this bit. > > The bash manpage says N>&DIGIT- redirects fd DIGIT to fd N. N may be > unspecified and defaults to 1. > It doesn't say what happens if DIGIT is unspecified. Hm, that's interesting. It looks like they forgot to document it. I've just tested it with bash-3.2 and it works as expected. > Nor does it say it closes any file descriptors. Well, if we assume that this fragment is correct, then it does: DIGIT is closed after being duplicated to N. There's also the following in bash-4.2 info page: If >&- or <&- is preceded by {VARNAME}, the value of VARNAME defines the file descriptor to close. But IMO it's more like describing a specific case, rather than introducing >&-. -- Best regards, Michał Górny
signature.asc
Description: PGP signature
