On Wed, May 24, 2017 at 8:15 AM, Joerg Schilling <joerg.schill...@fokus.fraunhofer.de> wrote: >> $ a=1 ./sh -o posix -c 'a=2; printenv a' >> 1 >> >> POSIX requires 2 to be output there (assuming printenv a command >> to print the value of a given environment variable). > > Do you have a pointer to the related text?
I write scripts every day that depend on POSIX behavior here, so I would be cross at a shell that outputs '1' in this case. FWIW, http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html says "If a variable is initialized from the environment, it shall be marked for export immediately".