This file is part of "locatedir"
by Alexander Kourakos <awk@vt.edu>

Copyright (C) 1994 Alexander Kourakos
All rights reserved.

OVERVIEW
--------

This is locatedir, a program I created to implement an "NCD" command
similar to the one in Norton Utilities.

It creates a list of all your directories, and lets you change to
arbitrarily deep subdirectories simply by specifying a few letters of the
final directory name.

I put minimal effort into this program, however I use it every day and find
it extremely useful. I haven't found anything similar for Linux, except the
one bundled with Northern Commander, which I don't use. It also seems more
elegant than the "jump" program on Sunsite.

INSTALLATION
------------

Look through ./Makefile and ./locatedir.h. You probably shouldn't change
anything.

Just type "make install". The makefile builds the binary and then installs
it and the man page.

In order to use locatedir as an "NCD" command, you must add something to
your shell startup file, because a stand-alone program can't really be used
to change directories.

Here is what you should add to your startup file (~/.profile, ~/.cshrc,
etc).

   bash:          function ncd() { cd "`locatedir $*`" }

   csh/tcsh:      alias ncd 'cd "`locatedir \!*`"'

If you don't use one of these shells, you might have to figure something
similar out. I don't have any shells besides these three.

You may want to add these to new user's default startup files, so that all
new accounts can use the "NCD" command.

USE
---

The man page should explain everything. Read it soon.

The general purpose of this is to speed up changing to a directory. For
example, I can type "ncd loc" and I will have my directory instantly
changed to "/home/awk/work/c/new/locatedir".

It works like you'd expect...case doesn't matter, and if you have multiple
directories that match, repeatedly executing the command will cycle through
all of the directories.

locatedir creates a file in your home directory called ".dirlist". Don't
edit this, it has been created for the use of locatedir only.

One annoying feature may be that it automatically rebuilds the ".dirlist"
file every 7 days. You may turn this off with the "-n" flag or change the
number of days in "locatedir.h". Or maybe run "locatedir -r >/dev/null"
from a crontab entry. Whatever. I didn't figure out a good (fast) way to
have the program know when the directory structure had changed.

ETC
---

Originally, I wanted to make it search for any directory containing the
requested string as a substring, however, I think it makes more sense to
just match the string at the beginning. I _know_ the directory name, I just
don't want to type it all.

There is a lot of nasty code in here. Don't look at it. :-)

I hope you find this useful. I sure do. If you have any suggestions or
problems, please send some e-mail.

Alexander Kourakos
awk@vt.edu
