$cwd in prompt???

John Huffman skeeve at hpb.cis.pitt.edu
Wed Jun 19 01:16:54 AEST 1991


In article <17153 at darkstar.ucsc.edu> bjsvec at cats.ucsc.edu (Brandon Jason Svec) writes:
>
>
>Can someone tell me how to get my prompt to show the current working directory?
>
>I have tried something like this:
>
>alias cd "cd;set prompt = $cwd"  # so it will update each time I cd
>set prompt = $cwd

I use the following in my .cshrc:

alias setprompt 'set prompt="`/usr/ucb/hostname`:`pwd`#\\!>"'
alias cd 'chdir \!* && setprompt'
alias pushd 'pushd \!* && setprompt'
alias popd 'popd \!* && setprompt'
setprompt

This takes care of at least most of the cases.

						- John Huffman



More information about the Comp.unix.questions mailing list