2

After installing python(EPDFee), I want to add the /bin directory to $PATH variable. I am use bash shell. I have found that I have to add the following line in the file .bashrc

export PATH=/home/usrname/epd/bin:$PATH

I have found the file .bashrc, it reads

PATH=$PATH:/opt/bin

# Added by Canopy installer on 2014-03-29

# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1

VIRTUAL_ENV_DISABLE_PROMPT=1 source /home/an/Enthought/Canopy_64bit/User/bin/activate

Could you please tell me where can I add export PATH=/home/usrname/epd/bin:$PATH to or is should be added in another file?

jiadong
  • 318
  • 5
  • 16

2 Answers2

2

add the following line to your .bashrc file ...don't forget to replace your path.

export PATH="/path/directory:$PATH"

then do

source .bashrc

to let the changes make effects. I am not sure about other distributions of Linux but It will work on CentOS and RedHat.

1

You can do it like this : Define a EPD_HOME var and append it to PATH

EPD_HOME=/home/usrname/epd/bin    
PATH=$PATH:$EPD_HOME:$HOME/bin
export PATH

Notice that the $EPD_HOME variable is in the PATH variable and is now loaded once you open a connection to your user on the machine.

Liviu Jianu
  • 110
  • 8
  • 1
    Thank you for your helpful answer! After I add like this,how can I test it to make sure it works? – jiadong Apr 16 '14 at 16:35
  • That is very easy. You simply open a new terminal to the server and just type `echo $EPD_HOME` and it should print the `/home/usrname/epd/bin` – Liviu Jianu Apr 16 '14 at 16:49
  • @Jianu Thanks! I use echo to test, but the output is a blank line, nothint printed. Now the **.bashrc** file reads `PATH=$PATH:/opt/bin` `EPD_HOME=/home/an/Enthought/Canopy_64bit/User/bin` `PATH=$PATH:$EPD_HOME:$HOME/bin` `export PATH` `VIRTUAL_ENV_DISABLE_PROMPT=1 source /home/an/Enthought/Canopy_64bit/User/bin/activate` Is it ok? – jiadong Apr 16 '14 at 17:09
  • You should group it this way: `VIRTUAL_ENV_DISABLE_PROMPT=1 EPD_HOME=/home/an/Enthought/Canopy_64bit/User/bin PATH=$PATH:$EPD_HOME:$HOME/bin export PATH` All the variables are declared before the PATH initialization and export. Also, you only need one PATH=$PATH appending, there is no need to use it twice. Also, please read a comparation of when you should use `.bash_profile` and when you should use `.bashrc` – Liviu Jianu Apr 16 '14 at 18:23