`pwd` in Shell prompt

Stafford Winters winterss at psu-cs.UUCP
Mon Apr 4 06:36:18 AEST 1988


In article <12752 at brl-adm.ARPA> parrish at nadc.arpa (D. Parrish) writes:
>	CSH:
>		To set your prompt variable to show the current path:
>			set prompt="`pwd`"
>			alias setprompt 'set prompt="`pwd`"'
>			alias cd 'cd \!* ; setprompt'
>			alias pd 'pushd \!* ; setprompt'
>			alias popd 'popd \!* ; setprompt'
>	
   I suggest using the string that is already calculated for you:
            set prompt="$cwd"
            alias cd 'cd \!* ; set prompt="$cwd"'
            alias pushd 'pushd \!* ; set prompt="$cwd"'
   etc.
   I find it helpful to highlight my directory as well.  If you always use
the same type of terminal, then you can insert the appropriate control
sequences to do the highlighting.
>	
>	CSH:	Insert the prompt=... stuff into your '.cshrc' file.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ______
    /        /
 --/ __.  __/
(_/ (_/|_(_/_     Stafford `Tad' Winters
Internet: winterss%psu-cs.cs.pdx.edu      or     winters%jacobs.cs.orst.edu
UUCP: {ihnp4,tektronix}!{psueea!psu-cs!winterss,orstcs!jacobs!winters}
BITNET (for some): IN%"winters%jacobs.cs.orst.edu"



More information about the Comp.unix.questions mailing list