[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why can't I say "&>&3"? Bug or feature?
From: |
Chet Ramey |
Subject: |
Re: Why can't I say "&>&3"? Bug or feature? |
Date: |
Thu, 06 Dec 2012 09:18:02 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 12/6/12 5:48 AM, Tim Friske wrote:
> Hi folks,
>
> why is it that I can't say:
>
> exec 3>/dev/null
> echo foobar &>&3
> # Error: "-bash: syntax error near unexpected token `&'"
Because the shorthand &> wasn't extended to arbitrary file descriptors.
> but the following works:
>
> echo foobar &>/dev/null
> echo foobar >&3 2>&3
>
> I think the succinct notation "&>&N" where N is some numbered file
> descriptor should work also. Is this behavior a bug or feature?
It's simply a feature that was never implemented because there was
little or no demand.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/