When I use any command with sudo the environment variables are not there. For example after setting HTTP_PROXY the command wget
works fine without sudo
You can also combine the two env_keep
statements in Ahmed Aswani's answer into a single statement like this:
Defaults env_keep += "http_proxy https_proxy"
You should also consider specifying env_keep
for only a single command like this:
Defaults!/bin/[your_command] env_keep += "http_proxy https_proxy"