-----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 c...@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-----