bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using set +o posix unsets POSIXLY_CORRECT, even when POSIXLY_CORRECT


From: Cuong Manh Le
Subject: Re: using set +o posix unsets POSIXLY_CORRECT, even when POSIXLY_CORRECT is a read only variable
Date: Fri, 1 Jan 2016 23:51:01 +0700

readonly var=value prevent shell scripter changing value of variable var, there is no restriction for the shell itself.

Try:

set -o posix
readonly | grep SHELLOPTS

and:

set +o posix
readonly | grep SHELLOPTS

to see the missing of `posix` in 2nd command, the readonly variable SHELLOPTS was changed by the shell.

On Fri, Jan 1, 2016 at 7:04 AM, nerdopolis <address@hidden> wrote:
I tested on
4.2.45(1)-release

basically I have tested
address@hidden:~$ readonly POSIXLY_CORRECT=1
address@hidden:~$ set +o posix
address@hidden:~$ echo $POSIXLY_CORRECT

address@hidden:~$

Although I will admit I'm not sure if it's supposed to do that or not



reply via email to

[Prev in Thread] Current Thread [Next in Thread]