More cd/pushd aliases - (nf)
utzoo!decvax!pur-ee!davy
utzoo!decvax!pur-ee!davy
Fri Sep 10 12:32:33 AEST 1982
#N:pur-ee:9200004:000:1121
pur-ee!davy Sep 10 11:44:00 1982
About 6 months ago, I posted the following aliases to use with
"csh". By using these aliases, your current working directory is always
kept in your prompt. Note that you will need to put a 'cd' into either
.cshrc or .login, so that when you first log in, your prompt will look
right (until you do a cd, pushd, or whatever, $cwd has no value). The
current "history number" is also placed in the brackets.
set prompt='$cwd\[!\]\ '
alias cd chdir \!:\* \; set prompt='$cwd\[!\]\ '
alias pd pushd \!:\* \; set prompt='c:$cwd\[!\]\ '
alias pp popd \!:\* \; set prompt='c:$cwd\[!\]\ '
Now, after wrestling with quotes, backquotes, and other attrocities,
I have finally figured out how to combine my prompt with the directory
stack stuff sent in by burdvax!puder. The "setprompt" alias is needed to keep
the quotes ("'") separated.
alias setprompt set prompt='$cwd\[!\]\ '
alias cd 'chdir \!*; set ds=(`dirs`); setprompt'
alias pd 'pushd \!*; set ds=(`dirs`); setprompt'
alias pp 'popd \!*; set ds=(`dirs`); setprompt'
Enjoy,
--Dave Curry, Purdue E.E. Department
decvax!pur-ee!davy ihnss!pur-ee!davy
More information about the Comp.sources.unix
mailing list