
The ECN No Name Newsletter is no longer being published. This is an archived issue.
[previous article] [next article]You have a UNIX path! It was set up when your account was created and you have been using it from day one. With UNIX you use a shell (Bourne or C- shell) and at the shell level you type in commands, for example ls. Your shell does not include a complete set of UNIX commands, rather it uses the PATH to inform it which files and directories to search to find the correct instruction code on how a command should be interpreted.
To look at your PATH, type "echo $PATH". Mine looks like this:
:/usr/ecn:/usr/ucb:/bin:/usr/bin:/usr/new :/usr/local:/usr/custom:/usr/unsup:.
UNIX permits a person to customize their PATH. This might be done to access a unique program for a class or a research project. Once this unique program is included in your PATH it will be automatically found and you will not be required to load it separately. To customize your PATH edit the appropriate file. Below I am adding my personal bin directory to my PATH. This directory is located in my HOME directory.
BOURNE SHELL: C-SHELL: % ex .profile % ex .login :a :a PATH=($PATH:$HOME/bin) set path=($path ~/bin) . . :wq :wq
Now when I ask to see my PATH it looks like this with $HOME expanded to a full pathname.
:/usr/ecn:/usr/ucb:/bin:/usr/bin:/usr/new:/usr /local:/usr/custom:/usr/unsup:.:/cn2/stacey/bin:
With this addition to my PATH, the next time I log in my personal bin directory will also be searched for commands. Below I am creating my directory bin and placing a file that is executable and readable by me (mode 700) within it.
% ls bin [ make sure you don't have a bin]
bin not found
% mkdir bin [ make directory "bin"]
% cd bin [change directory to "bin"]
% ex landscape
"landscape" [New File]
:a
1 nmt -Tpsc -t -e -g $1 | psdit -p/land.pro |
lpr -Pka6 -l -h
.
:wq
"landscape" 1 line, 61 characters
% ls bin
landscape
% cd ..
% rehash
With the landscape command now part of my PATH when I wish to print a file width-wise on a page, I type "% landscape filename".