![]() |
Fixing your PATH variableIf you try to run either emacs or make and you get the following (or similar) message: bash: emacs: command not found it means that the command you've tried cannot be found in any of the directories listed in your shell's PATH variable. (You get this same message if you try to run a.out when the current directory is not in your path.) To check, type: echo $PATH You should see something like this: /usr/j2se/bin:/bin:/usr/bin:/usr/local/bin:/usr/ccs/bin:
You need to have Quick FixIf you are running the bash shell (those of you who had me for 211 probably still are), you can just copy my .bashrc file again: cd ~ (The first command just makes sure you're in your home directory.) Login again after doing this and the problem should be fixed. Long WayIf you're interested in seeing how these things work, you can edit your PATH variable yourself. First figure out what shell you're using based on what your prompt looks like when you first log in:
(If you can scroll up through your previous commands by using the up arrow, you're using either bash or tcsh.) Open (using pico, emacs, or your favorite editor) the config file corresponding to your shell. Look for where a PATH variable is initialized. Add any extra paths you need. You will need to login in again in order for your changes to take effect. SIDENOTE: Remember that the order is important--your shell will look for programs through the paths in the order specified. For this reason, you never want to put the current directory (./) first. (Some say it shouldn't be included at all.) If you list the current directory first, you can imagine a situation where you wander into a strange directory and do an Finding the proper path for a program
In order to add the correct path to your PATH variable, you need to know where a certain program is located. You can use the Or, what I do on uhunix, is switch back to C shell, use the which command, and then exit back out of C shell: csh
Here I learned that, in order to run emacs, I need to have |
~ztomasze Index :
TA Details : ICS212 : Emacs Path http://www2.hawaii.edu/~ztomasze |
Last Edited: 05 Nov 2005 ©2005 by Z. Tomaszewski. |