Path: csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail From: Chet Ramey Newsgroups: gnu.bash.bug Subject: Re: [POSIX] `a='a b'; export a=$a; echo $a` gives `a b` instead of `a` Date: Sat, 5 Dec 2015 19:26:17 -0500 Organization: ITS, Case Western Reserve University Lines: 43 Approved: bug-bash@gnu.org Message-ID: References: <566379E8.3040705@gmail.com> Reply-To: chet.ramey@case.edu NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1449361585 24872 208.118.235.17 (6 Dec 2015 00:26:25 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: "Mingye Wang (Arthur2e5)" , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <566379E8.3040705@gmail.com> X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.566380AA.001F,ss=1,re=0.000,fgs=0, ip=40.133.163.73, so=2015-08-12 04:07:17, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: be15400ce20ad2cafb3d31c538db7c15 X-Junkmail-Whitelist: YES (by domain whitelist at mpv4-2015.case.edu) X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.566380AA.00A3,ss=1,re=0.000,fgs=0, ip=40.133.163.73, so=2015-08-12 04:07:17, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 2708b0b498bcd2cf7774b8ddde7cbcfc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 129.22.103.195 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11956 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/5/15 6:57 PM, Mingye Wang (Arthur2e5) wrote: > Bash Version: 4.3 > Patch Level: 42 > Release Status: Release > > Description: > According to [POSIX.1], `export` is special builtin *command*. > Therefore as a command, in `a='a b'; export a=$a; echo $a`, `$a` should > get split into words `a` and `b`. > > However, `bash` takes this as `export 'a=a b'` and gives un-POSIX > results. To make sure this is not a `bash` extension since this is > actually a common headache for new users and `bash` may try to extend > its syntax here, I tried `bash --posix`, but it exhibits the same > non-POSIX behavior. This has come up before. The current (amended) version of the Posix standard contains the following (approved) interpretation dating from 2010-2011: http://austingroupbugs.net/view.php?id=351 which addresses exactly this case. Bash is conformant, dash needs to be updated, or will be when this amended version of the standard is published. - -- ``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 v2 Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlZjgKEACgkQu1hp8GTqdKsK/ACgnzR6FE55Gyctqhsg/hyX3AIS Xo8AmwRZmxKJhNo6KcQp5NqpSljio07a =6FAj -----END PGP SIGNATURE-----