help-bash
[Top][All Lists]
Advanced

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

Re: Do `>& -` and `<& -` also work?


From: Koichi Murase
Subject: Re: Do `>& -` and `<& -` also work?
Date: Tue, 11 May 2021 02:01:28 +0900

2021年5月10日(月) 23:13 Peng Yu <pengyu.ut@gmail.com>:
> The manual only mentions `>&-` and `<&-`. Do `>& -` and `<& -` also work?

Yes. They should also work. They are mentioned in the section I have
already quoted in
https://lists.gnu.org/archive/html/help-bash/2021-05/msg00005.html

> $ exec 42>& -
> $ exec 42<& -
>
> Could anybody confirm?

Yes, they work. You can confirm it for yourself by using the loadable
builtin `fdflags' or by using "ls -la /proc/$$/fd" if your system has
procfs.

> If they both work, is this made by design?

Yes, I think so because it is explicitly mentioned in the manual (the
section I have quoted in
https://lists.gnu.org/archive/html/help-bash/2021-05/msg00005.html ).

I think the reason for having in parse.y « NUMBER LESS_AND '-' », etc.
separately from « NUMBER LESS_AND WORD » is just for optimization
similar to the case of NUMBER as described in Chet's reply
https://lists.gnu.org/archive/html/help-bash/2021-05/msg00008.html .



reply via email to

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