Environment Variables not working in WSL`http_proxy` not showing up with `printenv` on WSLWhat's the difference between set, export and env and when should I use each?Changing the value of $HOME in .bashrcDefault environment for screen is /bin/sh when it should be /bin/bash?Making global variables persistent in bash shellSet environment variable globallyDisallow compromising aliases & functions; alias cd='rm -rf ~'How to set up a loop in csh to set variables to directory names?Do terminal tabs correspond to different shells?
Finding a solution to a linear program with a small number of zeros
Writing style in academic English
Aliens kill as an art form, surprised that humans don't appreciate
Is there a guide/reference for possible character hairstyles in D&D Forgotten Realms universe?
What is this book about Satan having to run the world
Ideas for medieval currency
Is it true that almost everyone who starts a PhD and sticks around long enough can get one?
Dropping "to be" and other verbs in Latin?
Can we define fundamental groups functorially for non-pointed path connected topological spaces?
Summary Proceeding in New Zealand - Denying liability but not requesting a hearing
Could a chess engine do retro analysis?
Does a buffer overflow vulnerability always mean a code execution vulnerability?
Chess Tournaments without Studying Theory?
Is "You are influencing your negative behavior over me" grammatically well-formed and natural-sounding to native speakers?
Do the holes in Jacquard loom punched cards represent input data or program code?
I've got an error "This site is blocked due to content filtering."
Is economics a science?
A Stack Exchange Answerer
Why give an android emotions?
How will the next Sanhedrin function if we lost the original Semicha?
How to create animation with svg format file?
What is the difference between "more" and "less" commands?
Can you counterspell a spell if you don't know who's casting it?
Was X17 predicted before it was observed?
Environment Variables not working in WSL
`http_proxy` not showing up with `printenv` on WSLWhat's the difference between set, export and env and when should I use each?Changing the value of $HOME in .bashrcDefault environment for screen is /bin/sh when it should be /bin/bash?Making global variables persistent in bash shellSet environment variable globallyDisallow compromising aliases & functions; alias cd='rm -rf ~'How to set up a loop in csh to set variables to directory names?Do terminal tabs correspond to different shells?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I have used the commands
export http_proxy=address:port
and
export https_proxy=address:port
to set http and https proxy in bash in WSL. But every time I open bash, the environment variables are becoming empty. I tried setting up these variables in /etc/environment
and ~/.bashrc
too.
I am using bash.exe
command in cmd promt to open bash.
bash gnome-terminal bashrc windows-subsystem-for-linux
add a comment
|
I have used the commands
export http_proxy=address:port
and
export https_proxy=address:port
to set http and https proxy in bash in WSL. But every time I open bash, the environment variables are becoming empty. I tried setting up these variables in /etc/environment
and ~/.bashrc
too.
I am using bash.exe
command in cmd promt to open bash.
bash gnome-terminal bashrc windows-subsystem-for-linux
At least partially related I think:http_proxy
not showing up withprintenv
on WSL
– steeldriver
Feb 10 at 11:49
add a comment
|
I have used the commands
export http_proxy=address:port
and
export https_proxy=address:port
to set http and https proxy in bash in WSL. But every time I open bash, the environment variables are becoming empty. I tried setting up these variables in /etc/environment
and ~/.bashrc
too.
I am using bash.exe
command in cmd promt to open bash.
bash gnome-terminal bashrc windows-subsystem-for-linux
I have used the commands
export http_proxy=address:port
and
export https_proxy=address:port
to set http and https proxy in bash in WSL. But every time I open bash, the environment variables are becoming empty. I tried setting up these variables in /etc/environment
and ~/.bashrc
too.
I am using bash.exe
command in cmd promt to open bash.
bash gnome-terminal bashrc windows-subsystem-for-linux
bash gnome-terminal bashrc windows-subsystem-for-linux
edited Sep 18 at 17:20
user3140225
2,6904 gold badges12 silver badges24 bronze badges
2,6904 gold badges12 silver badges24 bronze badges
asked Feb 10 at 5:10
Bhanu Prakash ReddyBhanu Prakash Reddy
1
1
At least partially related I think:http_proxy
not showing up withprintenv
on WSL
– steeldriver
Feb 10 at 11:49
add a comment
|
At least partially related I think:http_proxy
not showing up withprintenv
on WSL
– steeldriver
Feb 10 at 11:49
At least partially related I think:
http_proxy
not showing up with printenv
on WSL– steeldriver
Feb 10 at 11:49
At least partially related I think:
http_proxy
not showing up with printenv
on WSL– steeldriver
Feb 10 at 11:49
add a comment
|
1 Answer
1
active
oldest
votes
If you use export, you can only use the environment variables on that terminal session. Else, you have to add it to /etc/enviroment.
But if you aren't logged in as root, you can't use it. You should change the permissions of the file.
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117061%2fenvironment-variables-not-working-in-wsl%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you use export, you can only use the environment variables on that terminal session. Else, you have to add it to /etc/enviroment.
But if you aren't logged in as root, you can't use it. You should change the permissions of the file.
add a comment
|
If you use export, you can only use the environment variables on that terminal session. Else, you have to add it to /etc/enviroment.
But if you aren't logged in as root, you can't use it. You should change the permissions of the file.
add a comment
|
If you use export, you can only use the environment variables on that terminal session. Else, you have to add it to /etc/enviroment.
But if you aren't logged in as root, you can't use it. You should change the permissions of the file.
If you use export, you can only use the environment variables on that terminal session. Else, you have to add it to /etc/enviroment.
But if you aren't logged in as root, you can't use it. You should change the permissions of the file.
edited Sep 20 at 14:15
answered Sep 18 at 14:16
Damian Rodriguez ArataDamian Rodriguez Arata
13 bronze badges
13 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117061%2fenvironment-variables-not-working-in-wsl%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
At least partially related I think:
http_proxy
not showing up withprintenv
on WSL– steeldriver
Feb 10 at 11:49