up previous next contents
Next: Aliases Up: The C Shell Previous: Setting Your Search Path   Contents

Hashing and Hash Tables

When your csh shell is started, it searches through the directories listed in your path environment variable and then builds an internal table that contains a listing of the full pathnames of all of the executable programs it finds in these directories. Then, when a command is executed the shell can find the executables within this table rather than actually searching through the path at the time you decide to execute a code.

The hash table was originally designed for performance reasons. But what else does this mean to you? It means that if you create a new executable program, it will not be found, because your "path" variable will not be searched again.

If you want to execute your new program you have to do one of two things:

1. Specify the full path that leads to the executable program. Assume you are in the directory "/home/stu1/bin", and you have created a new executable file called "dirlist". To execute this file, you would type either of these two commands:

my_sys%  /home/stu1/bin/dirlist

my_sys%  ./dirlist

2. Use the rehash command. This command re-searches your path variable at the time you execute it, and then rebuilds the "hash table". In this way it will include any new executable files/programs you have created.


up previous next contents
Next: Aliases Up: The C Shell Previous: Setting Your Search Path   Contents