I know in unix/linux the enviroment variables are uppercase, like LD_LIBRARY_PATH ; HOME ; $USER and so on. Today playing with wget I saw this commands just uses lowercase enviroment variables:

env | grep -i proxy
wget -q http://google.it
echo $?
unset http_proxy
export HTTP_PROXY=
wget -q http://google.it
echo $?

Why wget doesn't read HTTP_PROXY in uppercase format?


This is just a guess, but project timelines would suggest that it's for backwards compatibility with Lynx, which predates curl by a few years (and which uses lower-case proxy variables).


Short answer: Unfortunately, different programs use different env variables.

Long answer, from (https://wiki.archlinux.org/index.php/proxy_settings#Environment_variables):

Some programs (like wget) use environment variables of the form "protocol_proxy" to determine the proxy for a given protocol. (...) Some programs look for the all caps version of the environment variables.

In the past, I've made a simple script that sets both versions (all caps and "regular" versions to toggle them on and off easily, and it seems that that is a common way of doing things if it must be done via env variables.


Unix is case sensitive. Which means that $http_proxy and $HTTP_PROXY are two different variables.

Look at this:

user@foo[~]+ xx=2
user@foo[~]+ echo $xx
user@foo[~]+ echo $XX

  • 1
    yes i know, the @Gerald Combs answers, is ok – c4f4t0r Feb 3 '14 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.