Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 166255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:03:57+00:00 2026-05-11T12:03:57+00:00

I have this in .bashrc; PS1=’$’ However, I see this still in terminal: mas-macbook:some/path

  • 0

I have this in .bashrc;

PS1=’$’

However, I see this still in terminal:

mas-macbook:some/path mas$

I want

$

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:03:57+00:00Added an answer on May 11, 2026 at 12:03 pm

    PS1 should already have been exported long before you get to your .bashrc file, at least for a login shell. In that case, setting PS1 should simply overwrite the value (not its export status).

    One thing to keep in mind is that bash itself does not run your .bashrc file for a login shell. The actual sequence of execution is:

    • /etc/profile, if there.
    • first of ~/.bash_profile, ~/.bash_login or ~/.profile.

    I’m fairly certain that, if you want .bashrc to run for a login shell, it has to be sourced from one of those above.

    For example, /etc/profile may call /etc/profile.local or all the scripts in the /etc/profile.d/ directory. Similarly, my .bash_profile calls the following, if they exist:

    • /etc/bash.bashrc
    • ~/.bashrc

    with the following snippet:

    if [ -e /etc/bash.bashrc ] ; then     source /etc/bash.bashrc fi if [ -e '${HOME}/.bashrc' ] ; then     source '${HOME}/.bashrc' fi 

    When I change PS1 and echo ‘hello‘ in my .bashrc, but comment out the sourcing of it in .bash_profile, the prompt doesn’t get changed (nor the string printed) when I log in. When I uncomment the sourcing, I get both the string printed and the prompt changed when I log in.

    To make sure that your .bashrc is called for your login shells, put that echo hello statement just after setting PS1, then log in to check.

    If it is being called when you log in, you can execute ‘export -p‘ from your shell to get a list of all the exported variables – make sure PS1 has a ‘declare -x‘ in front of it. If not, just change your .bashrc to export it as well:

    export PS1='$' 

    If it’s already exported, then something is changing it after your set statement. In that case, you’ll need to actually look at the login execution path to see what’s getting called before it gives you control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some stuff I want to perform in .bashrc which I would prefer
I have this .bashrc file #PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting [[
I have this self-defined function in my .bashrc : function ord() { printf '%d'
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT
Hi I have added this alias to my .bashrc: alias awrco='svn co https://x.x.com/x/x/x/projects/' I
I have a command I want to execute in .bashrc only when the current
I am having trouble getting PYTHONPATH set. I have added this line to ~/.bashrc
Hi I have this groovy script (in $FRAPID_HOME/bin) and I want to call it
Please help me understand this. Here you can see that I have PYTHONPATH set
I want to have my .bashrc detect if running emacsclient would work in lieu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.