alias to link cd to pwd

Peter Cash pcash at cxhq.UUCP
Thu Jul 20 04:44:25 AEST 1989


In article <3710 at tank.uchicago.edu>, phd_ivo at gsbacd.uchicago.edu writes:
> 
> A long time ago, I had a script that links a cd to
> reset the prompt to the currently connected directory.
...
> Could someone please post a copy of such an alias, please? 

I use the following solution:

# in .profile:

alias cd=c
. .functs

# in a separate file called ".functs":

c() { cd $1; PS1="`tput smso``pwd`:`tput rmso`
"; }

This prints the prompt as inverse video, and gives me an entire
line on which to enter long commands.  (This can be handy if the
cwd is long, also...)


Peter



More information about the Comp.unix.questions mailing list