Announcement

Collapse
No announcement yet.

setting PATH variable in bash

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    setting PATH variable in bash

    I've read the bash documentation - for the 5th time - every time I install a Linux distro, I have it read again.

    I'm trying to amend the PATH variable as follows:

    PATH="${PATH}":/usr/local/share/my_dir

    I have tried the following files with no change in the PATH variable
    • /etc/profile
    • /etc/bash.bashrc
    • ~/.profile
    • ~/.bashrc
    • ~/.bash_aliases


    I know that the PATH variable is getting set someplace, but not in any of the files specified by the bash docs.

    What files are being read by bash under Kubuntu??

    what file can I use to amend the PATH variable on a GLOBAL basis for all users??

    What file sets the PATH variable under Kubuntu?

    I was able to do this under Fedora Core 5 using one of the standard invocation files specified in the bash doc. That doesn't seem to work under Kubuntu. Why Not

    #2
    Re: setting PATH variable in bash

    Google gave me this:

    Code:
    export PATH=$PATH:/add/your/new/directory/here
    you can add the line to ~/.bashrc or to /etc/profile to add it for all users.
    Once your problem is solved please edit the first post of your topic and add [SOLVED] in front of the subject. In that way, others can benefit from your experience!

    Comment


      #3
      Re: setting PATH variable in bash

      Originally posted by JohanLingen
      Google gave me this:

      Code:
      export PATH=$PATH:/add/your/new/directory/here
      you can add the line to ~/.bashrc or to /etc/profile to add it for all users.
      Yes that is what worked under Fedora Core 5 - doesn't work under Kubuntu.

      Don't ask me why - I have no idea what is different about bash under Kubuntu, but NONE of the bash invocation files specified in the bash docs work under Kubuntu. I tried all of them - nothing changes the PATH variable and I cannot find any file where PATH is set !?!?!?!?!?

      Is this one of those things that the (K)Ubuntu developers changed

      Comment


        #4
        Re: setting PATH variable in bash

        Then look in ~/.profile

        There's a line that says:
        Code:
        PATH=~/bin:"${PATH}"
        I'd copy-paste that line into /etc/profile (as root) and change it according to your need.

        Does this work for you?
        Once your problem is solved please edit the first post of your topic and add [SOLVED] in front of the subject. In that way, others can benefit from your experience!

        Comment


          #5
          Re: setting PATH variable in bash

          Re-installed Kubuntu 7.10 from the Live CD

          the invocation file

          /etc/profile

          now works.

          Don't know why it didn't work before, but it does now.

          Thanks for the help.

          Comment


            #6
            Re: setting PATH variable in bash

            Globally, PATH is set/controlled by the /etc/environment file:
            (my /etc/environment file)
            PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
            LANG="en_US.UTF-8"
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Re: setting PATH variable in bash

              Originally posted by Snowhog
              Globally, PATH is set/controlled by the /etc/environment file:
              (my /etc/environment file)
              PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
              LANG="en_US.UTF-8"
              I am definitely going to have to store that away for future reference/knowledge.

              So many details, so little time.

              Comment

              Working...
              X