[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 .
- Do `>& -` and `<& -` also work?, Peng Yu, 2021/05/10
- Re: Do `>& -` and `<& -` also work?,
Koichi Murase <=
- Re: Do `>& -` and `<& -` also work?, Peng Yu, 2021/05/10
- Re: Do `>& -` and `<& -` also work?, Andreas Kusalananda Kähäri, 2021/05/10
- Re: Do `>& -` and `<& -` also work?, Peng Yu, 2021/05/10
- Re: Do `>& -` and `<& -` also work?, Chet Ramey, 2021/05/10
- Re: Do `>& -` and `<& -` also work?, Peng Yu, 2021/05/11
- Re: Do `>& -` and `<& -` also work?, Eli Schwartz, 2021/05/11
- Re: Do `>& -` and `<& -` also work?, Koichi Murase, 2021/05/12
- Re: Do `>& -` and `<& -` also work?, Peng Yu, 2021/05/12
- Re: Do `>& -` and `<& -` also work?, Koichi Murase, 2021/05/14
- Re: Do `>& -` and `<& -` also work?, Chet Ramey, 2021/05/14