Re^2: Prompt as Current Directory?

Scott Williamson scott at memex.co.uk
Tue Nov 21 18:03:15 AEST 1989


In article <1989Nov19.180921.20357 at ultra.com> rmg at ultra.com (Rich Geiger) writes:
>>In article <Nov.16.00.56.12.1989.9985 at paul.rutgers.edu> 
>>broadman at paul.rutgers.edu (Alan Broadman) writes:
>>>
>>>I have a (hopefully) simple question. How can you get the UNIX prompt
>>>to always reflect the path to the current directory.
>
>.................................................... somehow
>
>  /usr/baziotes/projs/releases/source/lint/obj/debug/notes/private %
>
>as a prompt is somewhat irritating. Doesn't leave much space for
>typing a command, either!
>

My solution is to only have the last two elements of the pathname in
the prompt. This still gives a good reminder as to where you are. The
following also includes username and hostname eg.

scott [doc: src/pcomm] : 

For .cshrc:

set hn=`hostname`
alias cd 'cd \!* ; set cwdh = $cwd:h ; set prompt = "$user [${hn}: $cwdh:t/$cwd:t] : "'
alias pushd 'pushd \!* ; cd .'
alias popd 'popd \!* ; cd .'
cd .



More information about the Comp.unix.questions mailing list