Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14499 > unrolled thread

Re: "sh -a" sets the POSIXLY_CORRECT *environment* variable

Started byChet Ramey <chet.ramey@case.edu>
First post2018-08-15 11:05 -0400
Last post2018-08-15 11:05 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: "sh -a" sets the POSIXLY_CORRECT *environment* variable Chet Ramey <chet.ramey@case.edu> - 2018-08-15 11:05 -0400

#14499 — Re: "sh -a" sets the POSIXLY_CORRECT *environment* variable

FromChet Ramey <chet.ramey@case.edu>
Date2018-08-15 11:05 -0400
SubjectRe: "sh -a" sets the POSIXLY_CORRECT *environment* variable
Message-ID<mailman.5142.1534345542.1292.bug-bash@gnu.org>
On 8/14/18 11:50 AM, Stephane Chazelas wrote:
> Hi,
> 
> This is from
> https://unix.stackexchange.com/questions/462333/why-does-a-in-bin-sh-a-affect-sed-and-set-a-doesnt
> (original investigation by Mark Plotnick)
> 
> Though not documented, enabling the POSIX mode in bash whether
> with
> 
> - bash -o posix
> - sh
> - env SHELLOPTS=posix bash
> - set -o posix # within bash
> 
> causes it to set the value of the $POSIXLY_CORRECT shell
> variable to "y" (if it was not already set)

Yes. This behavior dates from early 1997. It was put in on request so users
could get a posix environment from the shell, since GNU utilities
understand the POSIXLY_CORRECT variable. I could improve the documentation
there, but a 20-plus-year-old feature isn't going to change.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web