bug-bash
[Top][All Lists]
Advanced

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

Re: $SHELLOPTS after function with `local -'


From: Oğuz
Subject: Re: $SHELLOPTS after function with `local -'
Date: Fri, 24 Jul 2020 11:21:21 +0300

24 Temmuz 2020 Cuma tarihinde Grisha Levit <grishalevit@gmail.com> yazdı:

> The value of $SHELLOPTS is not always updated correctly after returning
> from a function that modifies options after using `local -'.
>
>
What version of bash is this? I can't reproduce the bug on 5.0.11.


> For example:
>
>     fun() { local -; set -u; }; fun
>     [[ $- == *u* ]]; echo $?                        # 1
>     [[ :$SHELLOPTS: == *:nounset:* ]]; echo $?      # 0
>
> This seems to be the case for the following set of options:
> interactive-comments, keyword, monitor, noclobber, noglob, nolog, notify,
> nounset, onecmd, physical, pipefail, privileged, verbose, xtrace
>
> While it works correctly for:
> allexport, braceexpand, emacs, errexit, errtrace, functrace, hashall,
> histexpand, history, ignoreeof, noexec, posix, vi
>
>

-- 
Oğuz


reply via email to

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