[SOLVED] red bash prompt after creating bash aliases

Tagged: , ,

  • This topic has 3 replies, 2 voices, and was last updated Sep 15-1:52 pm by Xecure.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41622
    Member
    dknestaut

      Hello all,

      I’d appreciate some help fixing an issue with my bash prompt. I have it set to the default configuration, but after I created a .bash_aliases file, it is now red as if I’m root. But I’m not root. I run the apt update and I’m prompted for a password. Running the command id shows that my UID is 1000. I can elevate my privileges to root without a problem, but it’s a cosmetic issue. I like being able to see at a glance whether I’m root or not.

      If I issue the command source .bashrc then my prompt goes back to the default pink and cyan colors. If I am in Vim, and I execute a shell command, the prompt will be the default pink and cyan. But if I open a new terminal, then the bash prompt is red again. Can anyone suggest what I might do to restore my bash prompt back to its previous behavior?

      • This topic was modified 2 years, 7 months ago by dknestaut.
      #41675
      Member
      Xecure
        Helpful
        Up
        0
        ::

        after I created a .bash_aliases file

        Is this file empty or did you add aliases there? Are these aliases copied from a different system that usually runs as root?
        The truth is that my experience with bash aliases is limited, so I don’t know how this can affect the user privileges.

        antiX Live system enthusiast.
        General Live Boot Parameters for antiX.

        #41703
        Member
        dknestaut
          Helpful
          Up
          0
          ::

          I fixed it with the following command:
          echo '. .bashrc' >> ~/.bash_profiles

          Turns out that bash wasn’t sure in what order to process everything, so the above command tells bash to source the bashrc file every time I open a terminal. My aliases all work and my terminal colors are all back to where they are supposed to be.

          #41733
          Member
          Xecure
            Helpful
            Up
            0
            ::

            Thanks for coming back and reporting your solution. It may help others in the future.

            antiX Live system enthusiast.
            General Live Boot Parameters for antiX.

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.