help-bash
[Top][All Lists]
Advanced

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

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


From: Chet Ramey
Subject: Re: Do `>& -` and `<& -` also work?
Date: Mon, 10 May 2021 15:22:38 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 5/10/21 10:12 AM, Peng Yu wrote:
Hi,

The manual only mentions `>&-` and `<&-`. Do `>& -` and `<& -` also work?

The first sentence is not true. That misunderstanding colors the question.

The manual (and POSIX) talks about [N]>&WORD and [N]<&WORD. WORD is a
separate token that is subject to expansion, and a token can be
separated from the previous token by one or more spaces. `-' is one
of the values for an expanded WORD for which the behavior is defined.


I tried the following and I don't see errors. But I can not be sure
whether `>& -` and `<& -` are exactly the same as `>&-` and `<&-`.

They are.

If they both work, is this made by design?

Yes. It's required.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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