Why can't I say "&>&3"? Bug or feature?

2012-12-06 Thread Tim Friske
Hi folks, why is it that I can't say: exec 3>/dev/null echo foobar &>&3 # Error: "-bash: syntax error near unexpected token `&'" 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.

Re: Why can't I say "&>&3"? Bug or feature?

2012-12-06 Thread Dan Douglas
On Thursday, December 06, 2012 11:48:09 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 `&'" > > but the following works: > > echo foobar &>/dev/null > echo foobar >&3 2>&3 > > I thin

Re: Why can't I say "&>&3"? Bug or feature?

2012-12-06 Thread Chet Ramey
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 fooba

Re: Why can't I say "&>&3"? Bug or feature?

2012-12-06 Thread DJ Mills
On Thu, Dec 6, 2012 at 6:11 AM, Dan Douglas wrote: > > I don't like &> to begin with. It makes the already cryptic redirection > syntax > that beginners struggle to understand even more confusing by adding a > pointless shortcut with a non-obvious meaning instead of just being > explicit. > If yo

Re: Why can't I say "&>&3"? Bug or feature?

2012-12-06 Thread Steven W. Orr
On 12/6/2012 12:06 PM, DJ Mills wrote: On Thu, Dec 6, 2012 at 6:11 AM, Dan Douglas wrote: I don't like &> to begin with. It makes the already cryptic redirection syntax that beginners struggle to understand even more confusing by adding a pointless shortcut with a non-obvious meaning instead o