Marking Your Place with a Shell Variable

The following alias will store the current directory name in a variable:

alias mark 'set \!:1=$cwd'

so as to use a feature of the C shell:

% mark here ... % cd here

One need not even type $here. If a directory does not exist, csh tries searching its cdpath (), then tries evaluating the name as a variable (, ).

(I generally use pushd and popd () to store directory names; mark is more useful with commands that need to look in two different paths, and there $here is necessary anyway. Ah well.)

[In bash, you can do this by setting the cdable_vars variable. (Put cdable_vars=1 in your shell setup file ().) -JP]

- CT in comp.unix.wizards on Usenet, 14 February 1987