[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug] Bash translates >&$var into &>$var for exported functions.
From: |
Chet Ramey |
Subject: |
Re: [bug] Bash translates >&$var into &>$var for exported functions. |
Date: |
Wed, 25 Jan 2012 16:02:12 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 1/23/12 2:50 AM, Dan Douglas wrote:
> Hello, In the case of exported functions, Bash interprets a copy descriptor
> followed by an expansion as the >& synonym for &>, resulting in the output
> going to a file named as the value of the FD it's given. This only applies
> to
> ">&$var" and not "<&$var". I've tested various quoting, Is there some way
> around this?
Nope, it's a bug. The command printing code is a little aggressive about
translating >& to &>. I've attached a patch that should be enough to
get you by.
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/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk8gbdQACgkQu1hp8GTqdKuy+wCgkdDB7H/C6gUj1X1q8u/UWang
AnYAn2SoWursp9ew88MBhY5dalLn1gSZ
=lgmc
-----END PGP SIGNATURE-----
print-redirects.patch
Description: Source code patch