~/.profile not being executed when Terminal opens? [OS X 10.6.8]












4















Somehow my bash prompt got changed to "elementary:~ steven$" and I want to change it back to the default prompt. I've added the following first to ~/.bashrc then to ~/.profile:



export PS1="s-v$ "


Neither get executed when I open Terminal. If I run the command source on either file it works fine for the remainder of that session.



Is there something I'm overlooking here?



EDIT: Here's output from what Ian suggested:



elementary:~ steven$ bash --login --verbose
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
/usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/usr/local/AVRMacPack/bin"; export PATH;

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi

PS1='h:W u$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
if [ -e "/usr/local/AVRMacPack" ]; then
PATH="$PATH:/usr/local/AVRMacPack/bin"
export PATH
fi

# Setting PATH for Python 3.2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}"
export PATH
elementary:~ steven$ which bash
which bash
/bin/bash









share|improve this question

























  • What was the default prompt before? Are you talking about a hostname change to 'elementary'?

    – jsejcksn
    Sep 12 '11 at 3:43
















4















Somehow my bash prompt got changed to "elementary:~ steven$" and I want to change it back to the default prompt. I've added the following first to ~/.bashrc then to ~/.profile:



export PS1="s-v$ "


Neither get executed when I open Terminal. If I run the command source on either file it works fine for the remainder of that session.



Is there something I'm overlooking here?



EDIT: Here's output from what Ian suggested:



elementary:~ steven$ bash --login --verbose
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
/usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/usr/local/AVRMacPack/bin"; export PATH;

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi

PS1='h:W u$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
if [ -e "/usr/local/AVRMacPack" ]; then
PATH="$PATH:/usr/local/AVRMacPack/bin"
export PATH
fi

# Setting PATH for Python 3.2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}"
export PATH
elementary:~ steven$ which bash
which bash
/bin/bash









share|improve this question

























  • What was the default prompt before? Are you talking about a hostname change to 'elementary'?

    – jsejcksn
    Sep 12 '11 at 3:43














4












4








4








Somehow my bash prompt got changed to "elementary:~ steven$" and I want to change it back to the default prompt. I've added the following first to ~/.bashrc then to ~/.profile:



export PS1="s-v$ "


Neither get executed when I open Terminal. If I run the command source on either file it works fine for the remainder of that session.



Is there something I'm overlooking here?



EDIT: Here's output from what Ian suggested:



elementary:~ steven$ bash --login --verbose
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
/usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/usr/local/AVRMacPack/bin"; export PATH;

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi

PS1='h:W u$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
if [ -e "/usr/local/AVRMacPack" ]; then
PATH="$PATH:/usr/local/AVRMacPack/bin"
export PATH
fi

# Setting PATH for Python 3.2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}"
export PATH
elementary:~ steven$ which bash
which bash
/bin/bash









share|improve this question
















Somehow my bash prompt got changed to "elementary:~ steven$" and I want to change it back to the default prompt. I've added the following first to ~/.bashrc then to ~/.profile:



export PS1="s-v$ "


Neither get executed when I open Terminal. If I run the command source on either file it works fine for the remainder of that session.



Is there something I'm overlooking here?



EDIT: Here's output from what Ian suggested:



elementary:~ steven$ bash --login --verbose
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
/usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/usr/local/AVRMacPack/bin"; export PATH;

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi

PS1='h:W u$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
if [ -e "/usr/local/AVRMacPack" ]; then
PATH="$PATH:/usr/local/AVRMacPack/bin"
export PATH
fi

# Setting PATH for Python 3.2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}"
export PATH
elementary:~ steven$ which bash
which bash
/bin/bash






macos bash prompt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 12 '11 at 3:35







Steven Zezulak

















asked Sep 12 '11 at 2:39









Steven ZezulakSteven Zezulak

161136




161136













  • What was the default prompt before? Are you talking about a hostname change to 'elementary'?

    – jsejcksn
    Sep 12 '11 at 3:43



















  • What was the default prompt before? Are you talking about a hostname change to 'elementary'?

    – jsejcksn
    Sep 12 '11 at 3:43

















What was the default prompt before? Are you talking about a hostname change to 'elementary'?

– jsejcksn
Sep 12 '11 at 3:43





What was the default prompt before? Are you talking about a hostname change to 'elementary'?

– jsejcksn
Sep 12 '11 at 3:43










3 Answers
3






active

oldest

votes


















5














.bashrc is only executed for non-interactive shells according to the bash man page.



.bash_profile is executed for login shells.



The .profile file is loaded by Korn shells. I don't know that bash pays any attention to this at all. I couldn't find any reference to it in the bash man page.



On OS X the Terminal.app program runs a login shell for every single new Terminal.app window you open.



So you want to put your prompt setup in .bash_profile.



You could always do the following in .bash_profile. It's not uncommon but I can't say what kind of repercussions it could have:



if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi


Then you wouldn't have to maintain two files.






share|improve this answer
























  • Still not working. Is there something that could be overriding it?

    – Steven Zezulak
    Sep 12 '11 at 3:14






  • 1





    It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

    – Ian C.
    Sep 12 '11 at 3:17











  • I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

    – Steven Zezulak
    Sep 12 '11 at 3:36






  • 1





    Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

    – Ian C.
    Sep 12 '11 at 3:53






  • 2





    .profile is read by bash as well, but only if .bash_profile does not exist.

    – grawity
    Sep 12 '11 at 7:38





















0














I might be incorrect but if bash is your shell, you must place that in your ~/.bash_profile and not your .bashrc.






share|improve this answer































    0














    In case you messed with your bash control for any reason and you wanna load your TERMINAL .profile in every session again, just write your ~/.bash_profile like so:



    if [ -f ~/.profile ]; then
    source ~/.profile
    fi


    ...and start a new session to check if everything went back OK






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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/3.0/"u003ecc by-sa 3.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%2fsuperuser.com%2fquestions%2f334526%2fprofile-not-being-executed-when-terminal-opens-os-x-10-6-8%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5














      .bashrc is only executed for non-interactive shells according to the bash man page.



      .bash_profile is executed for login shells.



      The .profile file is loaded by Korn shells. I don't know that bash pays any attention to this at all. I couldn't find any reference to it in the bash man page.



      On OS X the Terminal.app program runs a login shell for every single new Terminal.app window you open.



      So you want to put your prompt setup in .bash_profile.



      You could always do the following in .bash_profile. It's not uncommon but I can't say what kind of repercussions it could have:



      if [ -f ~/.bashrc ]; then
      source ~/.bashrc
      fi


      Then you wouldn't have to maintain two files.






      share|improve this answer
























      • Still not working. Is there something that could be overriding it?

        – Steven Zezulak
        Sep 12 '11 at 3:14






      • 1





        It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

        – Ian C.
        Sep 12 '11 at 3:17











      • I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

        – Steven Zezulak
        Sep 12 '11 at 3:36






      • 1





        Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

        – Ian C.
        Sep 12 '11 at 3:53






      • 2





        .profile is read by bash as well, but only if .bash_profile does not exist.

        – grawity
        Sep 12 '11 at 7:38


















      5














      .bashrc is only executed for non-interactive shells according to the bash man page.



      .bash_profile is executed for login shells.



      The .profile file is loaded by Korn shells. I don't know that bash pays any attention to this at all. I couldn't find any reference to it in the bash man page.



      On OS X the Terminal.app program runs a login shell for every single new Terminal.app window you open.



      So you want to put your prompt setup in .bash_profile.



      You could always do the following in .bash_profile. It's not uncommon but I can't say what kind of repercussions it could have:



      if [ -f ~/.bashrc ]; then
      source ~/.bashrc
      fi


      Then you wouldn't have to maintain two files.






      share|improve this answer
























      • Still not working. Is there something that could be overriding it?

        – Steven Zezulak
        Sep 12 '11 at 3:14






      • 1





        It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

        – Ian C.
        Sep 12 '11 at 3:17











      • I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

        – Steven Zezulak
        Sep 12 '11 at 3:36






      • 1





        Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

        – Ian C.
        Sep 12 '11 at 3:53






      • 2





        .profile is read by bash as well, but only if .bash_profile does not exist.

        – grawity
        Sep 12 '11 at 7:38
















      5












      5








      5







      .bashrc is only executed for non-interactive shells according to the bash man page.



      .bash_profile is executed for login shells.



      The .profile file is loaded by Korn shells. I don't know that bash pays any attention to this at all. I couldn't find any reference to it in the bash man page.



      On OS X the Terminal.app program runs a login shell for every single new Terminal.app window you open.



      So you want to put your prompt setup in .bash_profile.



      You could always do the following in .bash_profile. It's not uncommon but I can't say what kind of repercussions it could have:



      if [ -f ~/.bashrc ]; then
      source ~/.bashrc
      fi


      Then you wouldn't have to maintain two files.






      share|improve this answer













      .bashrc is only executed for non-interactive shells according to the bash man page.



      .bash_profile is executed for login shells.



      The .profile file is loaded by Korn shells. I don't know that bash pays any attention to this at all. I couldn't find any reference to it in the bash man page.



      On OS X the Terminal.app program runs a login shell for every single new Terminal.app window you open.



      So you want to put your prompt setup in .bash_profile.



      You could always do the following in .bash_profile. It's not uncommon but I can't say what kind of repercussions it could have:



      if [ -f ~/.bashrc ]; then
      source ~/.bashrc
      fi


      Then you wouldn't have to maintain two files.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 12 '11 at 2:51









      Ian C.Ian C.

      4,93812427




      4,93812427













      • Still not working. Is there something that could be overriding it?

        – Steven Zezulak
        Sep 12 '11 at 3:14






      • 1





        It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

        – Ian C.
        Sep 12 '11 at 3:17











      • I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

        – Steven Zezulak
        Sep 12 '11 at 3:36






      • 1





        Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

        – Ian C.
        Sep 12 '11 at 3:53






      • 2





        .profile is read by bash as well, but only if .bash_profile does not exist.

        – grawity
        Sep 12 '11 at 7:38





















      • Still not working. Is there something that could be overriding it?

        – Steven Zezulak
        Sep 12 '11 at 3:14






      • 1





        It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

        – Ian C.
        Sep 12 '11 at 3:17











      • I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

        – Steven Zezulak
        Sep 12 '11 at 3:36






      • 1





        Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

        – Ian C.
        Sep 12 '11 at 3:53






      • 2





        .profile is read by bash as well, but only if .bash_profile does not exist.

        – grawity
        Sep 12 '11 at 7:38



















      Still not working. Is there something that could be overriding it?

      – Steven Zezulak
      Sep 12 '11 at 3:14





      Still not working. Is there something that could be overriding it?

      – Steven Zezulak
      Sep 12 '11 at 3:14




      1




      1





      It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

      – Ian C.
      Sep 12 '11 at 3:17





      It's possible bash is being invoked with --noprofile or --norc. Try this, from a prompt run: bash --login --verbose -- does it print anything useful about what it's running? Also: which bash -- check to make sure bash hasn't been aliased.

      – Ian C.
      Sep 12 '11 at 3:17













      I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

      – Steven Zezulak
      Sep 12 '11 at 3:36





      I updated the first post with the output. It doesn't look like anything interesting or nulling is being executed.

      – Steven Zezulak
      Sep 12 '11 at 3:36




      1




      1





      Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

      – Ian C.
      Sep 12 '11 at 3:53





      Add the following to the start of ~/.bash_profile and ~/.bashrc: echo "Start of file $0". And to the end of each file: echo "End of file $0" and then try bash --login --verbose -- do you see the output from those? Are the files being sourced as expected?

      – Ian C.
      Sep 12 '11 at 3:53




      2




      2





      .profile is read by bash as well, but only if .bash_profile does not exist.

      – grawity
      Sep 12 '11 at 7:38







      .profile is read by bash as well, but only if .bash_profile does not exist.

      – grawity
      Sep 12 '11 at 7:38















      0














      I might be incorrect but if bash is your shell, you must place that in your ~/.bash_profile and not your .bashrc.






      share|improve this answer




























        0














        I might be incorrect but if bash is your shell, you must place that in your ~/.bash_profile and not your .bashrc.






        share|improve this answer


























          0












          0








          0







          I might be incorrect but if bash is your shell, you must place that in your ~/.bash_profile and not your .bashrc.






          share|improve this answer













          I might be incorrect but if bash is your shell, you must place that in your ~/.bash_profile and not your .bashrc.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 12 '11 at 2:50









          Zameer ManjiZameer Manji

          206128




          206128























              0














              In case you messed with your bash control for any reason and you wanna load your TERMINAL .profile in every session again, just write your ~/.bash_profile like so:



              if [ -f ~/.profile ]; then
              source ~/.profile
              fi


              ...and start a new session to check if everything went back OK






              share|improve this answer




























                0














                In case you messed with your bash control for any reason and you wanna load your TERMINAL .profile in every session again, just write your ~/.bash_profile like so:



                if [ -f ~/.profile ]; then
                source ~/.profile
                fi


                ...and start a new session to check if everything went back OK






                share|improve this answer


























                  0












                  0








                  0







                  In case you messed with your bash control for any reason and you wanna load your TERMINAL .profile in every session again, just write your ~/.bash_profile like so:



                  if [ -f ~/.profile ]; then
                  source ~/.profile
                  fi


                  ...and start a new session to check if everything went back OK






                  share|improve this answer













                  In case you messed with your bash control for any reason and you wanna load your TERMINAL .profile in every session again, just write your ~/.bash_profile like so:



                  if [ -f ~/.profile ]; then
                  source ~/.profile
                  fi


                  ...and start a new session to check if everything went back OK







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 13 at 10:55









                  PYKPYK

                  1013




                  1013






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • 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%2fsuperuser.com%2fquestions%2f334526%2fprofile-not-being-executed-when-terminal-opens-os-x-10-6-8%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

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix