alias to link cd to pwd

Ivan Warner,G44 SSTF,6632, iwarner at zaphod.axion.bt.co.uk
Fri Jun 9 20:15:53 AEST 1989


>From article <3710 at tank.uchicago.edu>, by phd_ivo at gsbacd.uchicago.edu:
 
> A long time ago, I had a script that links a cd to
> reset the prompt to the currently connected directory.
> 
> Unfortunately, I can't find it anymore, and my documentation
> is not telling me how to delay the execution of `pwd` in something
> like
> 
> 	alias cd "cd \!^ ; set prompt=`pwd`"
> 
> Could someone please post a copy of such an alias, please? 
> Incidentally, I am running a NeXT with Mach, a Berkeley 4.3BSD
> variation without ksh but with csh.
 

	Here's mine:

--------------------------------------------------------------------------
	alias cd '\!\! ; set prompt="! $cwd:t> "'
	alias pushd '\!\! ; set prompt="! $cwd:t> "'
	alias popd 'popd ; set prompt="! $cwd:t> "'
--------------------------------------------------------------------------

	This gives a prompt with the command number (useful for history
substitution) and the last component of the directory path (the tail).

	If you want the whole pathname in the prompt remove the `:t' after
the $cwd.


	Ivan Warner.



More information about the Comp.unix.questions mailing list