prompt changing on the fly

Chris Torek chris at mimsy.UUCP
Fri Jan 23 05:33:26 AEST 1987


(There is one good thing about the snow that shut down D.C. so that
 I am missing all the Usenix talks.  At least I get to catch up on
 news!  :-) )

In article <410 at moncskermit.oz> john at moncskermit.oz (John Carey) writes:
>Here is an alias for csh which replaces cd to change the prompt
>when moving directories
>
>The only problem I have found is that it must have an argument

(The cure for this is to use !*.)

>	alias nd cd \!\$\;set prompt=\`pwd\`\' \'

Here is one I have used in the past.  It preserves the C shell's
tilde notation.

	alias set_prompt 'set prompt="[\\!] `dirs|awk '\''{print "\$1"}'\''` "'
	alias cd 'cd \!*; set_prompt'
	alias pushd 'pushd \!*; set_prompt'
	alias popd 'popd \!*; set_prompt'
	set_prompt
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
UUCP:	seismo!mimsy!chris	ARPA/CSNet:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list