Environment Variable Location – Where is This Environment Variable Set?

bashcommand lineenvironment-variablesgnome-terminal

Whenever I open a terminal I have this variable set:

$ echo $http_proxy

Where is this variable being set? I've checked .bashrc, .bash_profile, /etc/bash.bashrc and /etc/environment and it's nowhere there?!

I've also looked at System Settings in the network section and the proxy is empty.

Best Answer

For bash run:

PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7> /tmp/mylog

then use

grep "http_proxy=" /tmp/mylog

to search for it.

You can also limit the search to /home and /etc for a better result:

$ grep "http_proxy=" /tmp/mylog | grep -e /home -e /etc
++/home/ravexina/.bashrc> http_proxy=http://test:80

which means it has been set in my ~/.bashrc.