bashrc not loaded on login

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











up vote
1
down vote

favorite












I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc after I log in. How can I save keystrokes so this is done automatically?







share|improve this question



















  • thats only for interactive shells - you might want to put those commands into ~/.profile or ~/.bash_profile instead
    – Steven Penny
    Jun 5 at 20:54










  • Is your default shell bash? .bashrc won't run for zsh, sh, ash, csh, etc.
    – DopeGhoti
    Jun 5 at 21:16










  • @DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
    – Rekall
    Jun 5 at 21:32














up vote
1
down vote

favorite












I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc after I log in. How can I save keystrokes so this is done automatically?







share|improve this question



















  • thats only for interactive shells - you might want to put those commands into ~/.profile or ~/.bash_profile instead
    – Steven Penny
    Jun 5 at 20:54










  • Is your default shell bash? .bashrc won't run for zsh, sh, ash, csh, etc.
    – DopeGhoti
    Jun 5 at 21:16










  • @DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
    – Rekall
    Jun 5 at 21:32












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc after I log in. How can I save keystrokes so this is done automatically?







share|improve this question











I created a new home directory for myself on my SSH server and when I log in my bashrc is never loaded, I always have to type . ~/.bashrc after I log in. How can I save keystrokes so this is done automatically?









share|improve this question










share|improve this question




share|improve this question









asked Jun 5 at 20:51









Rekall

83




83











  • thats only for interactive shells - you might want to put those commands into ~/.profile or ~/.bash_profile instead
    – Steven Penny
    Jun 5 at 20:54










  • Is your default shell bash? .bashrc won't run for zsh, sh, ash, csh, etc.
    – DopeGhoti
    Jun 5 at 21:16










  • @DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
    – Rekall
    Jun 5 at 21:32
















  • thats only for interactive shells - you might want to put those commands into ~/.profile or ~/.bash_profile instead
    – Steven Penny
    Jun 5 at 20:54










  • Is your default shell bash? .bashrc won't run for zsh, sh, ash, csh, etc.
    – DopeGhoti
    Jun 5 at 21:16










  • @DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
    – Rekall
    Jun 5 at 21:32















thats only for interactive shells - you might want to put those commands into ~/.profile or ~/.bash_profile instead
– Steven Penny
Jun 5 at 20:54




thats only for interactive shells - you might want to put those commands into ~/.profile or ~/.bash_profile instead
– Steven Penny
Jun 5 at 20:54












Is your default shell bash? .bashrc won't run for zsh, sh, ash, csh, etc.
– DopeGhoti
Jun 5 at 21:16




Is your default shell bash? .bashrc won't run for zsh, sh, ash, csh, etc.
– DopeGhoti
Jun 5 at 21:16












@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
– Rekall
Jun 5 at 21:32




@DopeGhoti Yes it is. If I were to use a different shell would there be a better way to go about this?
– Rekall
Jun 5 at 21:32










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










You could link your .bash_login - used when you login - to your .bashrc - used for other bash shell sessions:



mv -f .bash_login .bash_login.old # Don't worry if this says no such file
ln -s .bashrc .bash_login


Ensure that the commands in your .bashrc can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.






share|improve this answer




























    up vote
    0
    down vote













    Bash is not POSIX compliant here.



    Any interactive shell should read the file $ENV in the users home directory, but bash reads $HOME/.bash_login instead in case it is a login shell and even reads this file before reading $HOME/.profile instead of reading it after that file.



    Fortunately, this deviating behavior is documented in the bash man page under the section INVOCATION that starts aprox. at page #3.






    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%2f448079%2fbashrc-not-loaded-on-login%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
      1
      down vote



      accepted










      You could link your .bash_login - used when you login - to your .bashrc - used for other bash shell sessions:



      mv -f .bash_login .bash_login.old # Don't worry if this says no such file
      ln -s .bashrc .bash_login


      Ensure that the commands in your .bashrc can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.






      share|improve this answer

























        up vote
        1
        down vote



        accepted










        You could link your .bash_login - used when you login - to your .bashrc - used for other bash shell sessions:



        mv -f .bash_login .bash_login.old # Don't worry if this says no such file
        ln -s .bashrc .bash_login


        Ensure that the commands in your .bashrc can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.






        share|improve this answer























          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          You could link your .bash_login - used when you login - to your .bashrc - used for other bash shell sessions:



          mv -f .bash_login .bash_login.old # Don't worry if this says no such file
          ln -s .bashrc .bash_login


          Ensure that the commands in your .bashrc can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.






          share|improve this answer













          You could link your .bash_login - used when you login - to your .bashrc - used for other bash shell sessions:



          mv -f .bash_login .bash_login.old # Don't worry if this says no such file
          ln -s .bashrc .bash_login


          Ensure that the commands in your .bashrc can handle the possibility that they are being run without a terminal being connected. So don't print anything unless there's a terminal attached to stdout, for example.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jun 5 at 20:59









          roaima

          39.2k544105




          39.2k544105






















              up vote
              0
              down vote













              Bash is not POSIX compliant here.



              Any interactive shell should read the file $ENV in the users home directory, but bash reads $HOME/.bash_login instead in case it is a login shell and even reads this file before reading $HOME/.profile instead of reading it after that file.



              Fortunately, this deviating behavior is documented in the bash man page under the section INVOCATION that starts aprox. at page #3.






              share|improve this answer

























                up vote
                0
                down vote













                Bash is not POSIX compliant here.



                Any interactive shell should read the file $ENV in the users home directory, but bash reads $HOME/.bash_login instead in case it is a login shell and even reads this file before reading $HOME/.profile instead of reading it after that file.



                Fortunately, this deviating behavior is documented in the bash man page under the section INVOCATION that starts aprox. at page #3.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Bash is not POSIX compliant here.



                  Any interactive shell should read the file $ENV in the users home directory, but bash reads $HOME/.bash_login instead in case it is a login shell and even reads this file before reading $HOME/.profile instead of reading it after that file.



                  Fortunately, this deviating behavior is documented in the bash man page under the section INVOCATION that starts aprox. at page #3.






                  share|improve this answer













                  Bash is not POSIX compliant here.



                  Any interactive shell should read the file $ENV in the users home directory, but bash reads $HOME/.bash_login instead in case it is a login shell and even reads this file before reading $HOME/.profile instead of reading it after that file.



                  Fortunately, this deviating behavior is documented in the bash man page under the section INVOCATION that starts aprox. at page #3.







                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered Jun 6 at 10:39









                  schily

                  8,63821435




                  8,63821435






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448079%2fbashrc-not-loaded-on-login%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

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

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay