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


Groups > gnu.bash.bug > #14501

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

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: "sh -a" sets the POSIXLY_CORRECT *environment* variable
Date 2018-08-15 11:18 -0400
Message-ID <mailman.5148.1534356737.1292.bug-bash@gnu.org> (permalink)
References <20180814155026.rr3f52t7six2frsv@chaz.gmail.com> <3fc90f34-c477-52c7-e56d-83a54c91fbee@case.edu>

Show all headers | View raw


On 8/15/18 11:05 AM, Chet Ramey wrote:

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

This is probably less clear than it should be. The `standard' GNU way to
indicate that an application is, or should be, in posix mode is to set
POSIXLY_CORRECT. Bash had a couple of different ways to do it (--posix,
-o posix), and the request was that I add the standard way to indicate
posix mode. As a side effect, users could then export the variable to get
a POSIX environment using the GNU utilities. Anyway, it all happened long
ago.

-- 
``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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web