04-How to set PATH environment variable

by Gand — last modified 2004-06-01 10:44 PM
Create and edit .profile and .bashrc files using Terminal

video.gif Watch video

As Panther default shell is bash or if you are using sh or zsh:

Launch Terminal. terminal.jpg You'll find it in /Applications/Utilities


.profile

  • At the terminal prompt, to open the text editor pico and create a file named .profile,
    execute the following command typing (or copy/paste):
    pico .profile
term01.jpg
  • Press Return, when the text editor open, type (or copy/paste):
    source /sw/bin/init.sh
    at the end of the line press Return once.
term02.jpg
  • Then press Control-O, Return, and Control-X
    to save the file and return to the prompt.

.bashrc

  • Create a file named .bashrc typing (or copy/paste):
    pico .bashrc
term03.jpg
  • Press Return, when the text editor open, type (or copy/paste):
    [[ -z $DISPLAY ]] && export DISPLAY=":0.0"
    . /sw/bin/init.sh
    at the end of the line press Return once.
term04.jpg
  • Then press Control-O, Return, and Control-X
    to save the file and return to the prompt.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License