Wanted to know where shell environment variables are being set on linux and came across this helpful piece of scripting

PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>&2

Originally from StackOverflow