安裝python(EPDFee)後,我想將/ bin目錄添加到$ PATH變量中。我使用bash shell。我發現,我必須添加以下行文件中的.bashrc如何在文件.bashrc中添加PATH目錄?
export PATH=/home/usrname/epd/bin:$PATH
我已經找到了文件.bashrc中,它讀取
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
您能否告訴我在哪裏添加export PATH=/home/usrname/epd/bin:$PATH
或應該添加到另一個文件中?
謝謝你的幫助!添加完成後,我如何測試它以確保它可以正常工作? – jiadong
這很容易。你只需打開一個新的終端到服務器,只需鍵入'echo $ EPD_HOME',它應該打印'/ home/usrname/epd/bin' –
@Jianu謝謝!我使用echo來測試,但輸出是空白行,nothint打印。現在** .bashrc **文件讀取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'可以嗎? – jiadong