SETD

Section: User Commands (1)
Updated: 07 January 1992
Index Return to Main Contents
 

NAME

setd -
Filter program to change directory using marks, environment variables, or a built in queue.
 

SYNOPSIS

setd
[ options ] [ directory | mark [ /directory ] | env | offset | %directory ]
cd
[ options ] [ directory | mark [ /directory ] | env | offset | %directory ]
 

DESCRIPTION

setd, set directory, is a filter utility interfaced with change directory, cd(1) , to allow the user quick access to directory pathnames through marks, environment variables, offsets in a queue, etcetera.

Combined with the mark filter utility, mark(1) , setd provides a very powerful method to access frequently used directories through mark aliases. setd can also translate through a mark with a continuation of the directory description. Thus the user can set a mark in a base directory and attach to sub- directories under the base simply by specifying the mark + '/' + sub-directory structure.

setd also includes a queue which tracks a history of directory points for the current process. The depth of this queue is configurable by the user, and a simple offset is used to access a location in the queue.

The use of environment variables is also supported, along with traversal along the same level of a directory tree.  

INSTALLATION

setd installation is quick and painless. Both an environment variable and a cd alias must be set to store the queue database and set-up setd to filter into the change directory command respectively. Copying the two lines below for setd is all that is needed.


       setenv SETD_DIR /usr/tmp
       alias cd 'cd `setd *`'

In the specific example, $SETD_DIR points to the /usr/tmp area, though most users will wish to actually set the pointer to their bin area instead (for example, ~/bin).

The alias of cd simply filters all input through the setd program and directs the output to the cd command. To see setd in action, attempt to use setd separately, and notice the simple filtered output produced. When installed with the alias, all commands are seamless and accessible directly through cd.  

OPTIONS

-l<ist>
List queue.
History of past directory accesses, up to the maximum queue depth specified by -max (or defaulting to 10).
-m<ax>
Max queue depth.
Sets maximum depth for the history queue (defaults to a maximum depth of 10 unless otherwise specified).
-v<ersion>
Version number.
Displays the version of setd being run.
-h<elp>
Help message.
Enumerates all the options.
 

USAGE

When interfaced with cd, cd will perform exactly as before excepting for special character sequences which are filtered by setd. Below are several examples of cd with the setd filter.

(1) cd [ directory ]
A straight directory string is given, thus cd automatically changes to the given directory.
(2) cd [ mark ]
A mark alias was given, thus setd performs translation from the mark to the corresponding directory.
(3) cd [ env ]
An environment variable was specified, which is also translated from the variable into the corresponding directory.
(4) cd [ mark/directory ]
setd expands the given mark with the attached directory fully into the translated mark with the directory appended to the translated path.
(5) cd [ offset ]
Given a queue with a maximum depth of X, the offset number can take on values from zero through the maximum value minus one. The offset values are symmetric around zero, thus the following two lines are equivalent:

            cd -1          cd +1

Both of these commands read the directory in position one off the queue and set the user to the location. Notice position one corresponds to the last directory accessed.
(6) cd [ %directory ]
Finally, the percent (%) option can be placed in front of a directory name to allow the user to specify a directory at the same level of hierarchy with the one currently set to.
 

FILES

$SETD_DIR/setd_db  

SEE ALSO

mark(1), cd(1)  

AUTHOR

Sunil William Savkar
sunil@hal.com
HaL Computer Systems Corporation
December 26, 1991  

VERSION

Currently version 1.7, 1/7/92


 

Index

NAME
SYNOPSIS
DESCRIPTION
INSTALLATION
OPTIONS
USAGE
FILES
SEE ALSO
AUTHOR
VERSION

This document was created by man2html, using the manual pages.
Time: 06:18:18 GMT, December 12, 2024