bug-bash
[Top][All Lists]
Advanced

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

Re: SHELLOPTS environment variable causes shell options to cascade


From: Oğuz
Subject: Re: SHELLOPTS environment variable causes shell options to cascade
Date: Sun, 5 Jan 2025 08:18:57 +0300

On Saturday, January 4, 2025, Tobi Laskowski <tobil4sk@outlook.com> wrote:
>
> On the other hand, if there is a pre-existing SHELLOPTS environment
> variable (set outside the current shell), then the `nounset` option applies
> to all invocations of bash within the current shell.


This is documented in the manual:

> A colon-separated list of enabled shell options.
> If this variable is in the environment when Bash starts up, each shell
option in the list will be enabled before reading any startup files.


> To be clear, the intention here was to apply a specific shell option
> globally (namely igncr),


Try BASH_ENV instead:
https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-BASH_005fENV


-- 
Oğuz


reply via email to

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