Hello, A recent conversation with a member of our research team leads me to propose the following feature request:
A --debug-envvars flag which will, when passed to bash, catch every time an environment variable is set and print the file/line that is setting it. To restrict it, "--debug-envvars FOO,BAR" to catch only instances of FOO or BAR being set. Some vendor development environments substantially amend your environment when loaded (e.g. OneAPI) and others will, by default, flat out overwrite basic things like what compiler you're using (Hi there, Cray HPC toolkit!) and this sometimes leads to Issues. Even if not chasing down problems relating to such esoterica as these, the problem originated from one of our guys trying to chase down a mystery PATH entry being set by an AWS instance. In his words, "Yes! That'd be awesome! Would have saved me a lot of time the last year." I assume this is not already available, or Google would not have a thousand results from StackOverflow which are all some variation on the theme of "grep /etc for the variable name." -- Erik