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;









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.










share|improve this question



























  • At least partially related I think: http_proxy not showing up with printenv on WSL

    – steeldriver
    Feb 10 at 11:49

















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.










share|improve this question



























  • At least partially related I think: http_proxy not showing up with printenv on WSL

    – steeldriver
    Feb 10 at 11:49













0













0









0


1






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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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
















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










1 Answer
1






active

oldest

votes


















-2



















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.






share|improve this answer




























    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
    );



    );














    draft saved

    draft discarded
















    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









    -2



















    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.






    share|improve this answer































      -2



















      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.






      share|improve this answer





























        -2















        -2











        -2









        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.






        share|improve this answer
















        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.







        share|improve this answer















        share|improve this answer




        share|improve this answer








        edited Sep 20 at 14:15

























        answered Sep 18 at 14:16









        Damian Rodriguez ArataDamian Rodriguez Arata

        13 bronze badges




        13 bronze badges































            draft saved

            draft discarded















































            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.




            draft saved


            draft discarded














            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





















































            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









            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?