Fixing your PATH variable
If 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:
You should see something like this:
You need to have
If 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:
(The first command just makes sure you're in your home directory.) Login again after doing this and the problem should be fixed.
If 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:
Here I learned that, in order to run emacs, I need to have
|~ztomasze Index :
TA Details : ICS212 : Emacs Path
|Last Edited: 05 Nov 2005|
©2005 by Z. Tomaszewski.