Where did bash environment variable get initialized from?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












When I execute:



echo $PYTHONPATH


on command line I get the following output:



/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s


I looked into .bashrc file and found only one PYTHONPATH set



export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-package‌​s:$PYTHONPATH"


I also looked into .profile, /etc/environment and /etc/profile
but nowhere could I find PYTHONPATH.



My question is where did the above extra paths come from?







share|improve this question

















  • 1




    There is a FILES section man bash, check it for list of files, but please note that it could change from distro to distro
    – user996142
    May 8 at 18:12






  • 1




    See those dist-packages, and site-packages directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
    – Lucas Ramage
    May 8 at 19:51











  • @nrb Is there a .bash_profile?
    – Nasir Riley
    May 8 at 23:11










  • @NasirRiley No, Why?
    – nrb
    May 8 at 23:26










  • @nrb Because depending on the environment, that file usually exists to initialize bash sessions as does .bashrc.
    – Nasir Riley
    May 8 at 23:30














up vote
1
down vote

favorite












When I execute:



echo $PYTHONPATH


on command line I get the following output:



/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s


I looked into .bashrc file and found only one PYTHONPATH set



export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-package‌​s:$PYTHONPATH"


I also looked into .profile, /etc/environment and /etc/profile
but nowhere could I find PYTHONPATH.



My question is where did the above extra paths come from?







share|improve this question

















  • 1




    There is a FILES section man bash, check it for list of files, but please note that it could change from distro to distro
    – user996142
    May 8 at 18:12






  • 1




    See those dist-packages, and site-packages directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
    – Lucas Ramage
    May 8 at 19:51











  • @nrb Is there a .bash_profile?
    – Nasir Riley
    May 8 at 23:11










  • @NasirRiley No, Why?
    – nrb
    May 8 at 23:26










  • @nrb Because depending on the environment, that file usually exists to initialize bash sessions as does .bashrc.
    – Nasir Riley
    May 8 at 23:30












up vote
1
down vote

favorite









up vote
1
down vote

favorite











When I execute:



echo $PYTHONPATH


on command line I get the following output:



/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s


I looked into .bashrc file and found only one PYTHONPATH set



export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-package‌​s:$PYTHONPATH"


I also looked into .profile, /etc/environment and /etc/profile
but nowhere could I find PYTHONPATH.



My question is where did the above extra paths come from?







share|improve this question













When I execute:



echo $PYTHONPATH


on command line I get the following output:



/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.6/dist-package‌​s:/home/nehal/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s:/home/userx/anaconda3/lib/python3.5/dist-package‌​s


I looked into .bashrc file and found only one PYTHONPATH set



export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-package‌​s:$PYTHONPATH"


I also looked into .profile, /etc/environment and /etc/profile
but nowhere could I find PYTHONPATH.



My question is where did the above extra paths come from?









share|improve this question












share|improve this question




share|improve this question








edited May 8 at 21:01









Alex Tullenhoff

783




783









asked May 8 at 18:08









nrb

63




63







  • 1




    There is a FILES section man bash, check it for list of files, but please note that it could change from distro to distro
    – user996142
    May 8 at 18:12






  • 1




    See those dist-packages, and site-packages directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
    – Lucas Ramage
    May 8 at 19:51











  • @nrb Is there a .bash_profile?
    – Nasir Riley
    May 8 at 23:11










  • @NasirRiley No, Why?
    – nrb
    May 8 at 23:26










  • @nrb Because depending on the environment, that file usually exists to initialize bash sessions as does .bashrc.
    – Nasir Riley
    May 8 at 23:30












  • 1




    There is a FILES section man bash, check it for list of files, but please note that it could change from distro to distro
    – user996142
    May 8 at 18:12






  • 1




    See those dist-packages, and site-packages directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
    – Lucas Ramage
    May 8 at 19:51











  • @nrb Is there a .bash_profile?
    – Nasir Riley
    May 8 at 23:11










  • @NasirRiley No, Why?
    – nrb
    May 8 at 23:26










  • @nrb Because depending on the environment, that file usually exists to initialize bash sessions as does .bashrc.
    – Nasir Riley
    May 8 at 23:30







1




1




There is a FILES section man bash, check it for list of files, but please note that it could change from distro to distro
– user996142
May 8 at 18:12




There is a FILES section man bash, check it for list of files, but please note that it could change from distro to distro
– user996142
May 8 at 18:12




1




1




See those dist-packages, and site-packages directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
– Lucas Ramage
May 8 at 19:51





See those dist-packages, and site-packages directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
– Lucas Ramage
May 8 at 19:51













@nrb Is there a .bash_profile?
– Nasir Riley
May 8 at 23:11




@nrb Is there a .bash_profile?
– Nasir Riley
May 8 at 23:11












@NasirRiley No, Why?
– nrb
May 8 at 23:26




@NasirRiley No, Why?
– nrb
May 8 at 23:26












@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does .bashrc.
– Nasir Riley
May 8 at 23:30




@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does .bashrc.
– Nasir Riley
May 8 at 23:30










2 Answers
2






active

oldest

votes

















up vote
3
down vote













You can figure out which files are being sourced by tracing which files bash opens:



strace -e open bash -l


This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)






share|improve this answer




























    up vote
    0
    down vote













    On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':



    grep -R PYTHONPATH /etc 2>/dev/null






    share|improve this answer





















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442605%2fwhere-did-bash-environment-variable-get-initialized-from%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote













      You can figure out which files are being sourced by tracing which files bash opens:



      strace -e open bash -l


      This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)






      share|improve this answer

























        up vote
        3
        down vote













        You can figure out which files are being sourced by tracing which files bash opens:



        strace -e open bash -l


        This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)






        share|improve this answer























          up vote
          3
          down vote










          up vote
          3
          down vote









          You can figure out which files are being sourced by tracing which files bash opens:



          strace -e open bash -l


          This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)






          share|improve this answer













          You can figure out which files are being sourced by tracing which files bash opens:



          strace -e open bash -l


          This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered May 8 at 19:58









          Alex Tullenhoff

          783




          783






















              up vote
              0
              down vote













              On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':



              grep -R PYTHONPATH /etc 2>/dev/null






              share|improve this answer

























                up vote
                0
                down vote













                On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':



                grep -R PYTHONPATH /etc 2>/dev/null






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':



                  grep -R PYTHONPATH /etc 2>/dev/null






                  share|improve this answer













                  On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':



                  grep -R PYTHONPATH /etc 2>/dev/null







                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered May 8 at 21:25









                  John Doe

                  804




                  804






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442605%2fwhere-did-bash-environment-variable-get-initialized-from%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      iYshiy0S72B X A vdzPSdVSimssm9c DGKuK33mmGYpdznnEeP cg0XoGijqcwGKq9dGr ZKy
                      oVj6MJMOlvP8B0lRhTCy5pG aRqgMAuT k,AXRcjX5ntLo cTcw8 9ppHl

                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      How many registers does an x86_64 CPU actually have?

                      Displaying single band from multi-band raster using QGIS