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
(
14.5
)
, then tries evaluating the name as a
variable (
6.8
,
6.9
)
.
(I generally use
pushd
and
popd
(
14.6
)
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 (
2.2
)
.) -
JP
]
- in comp.unix.wizards on Usenet, 14 February 1987