prompt changing on the fly

terryl at tekcrl.UUCP terryl at tekcrl.UUCP
Fri Jan 23 04:10:12 AEST 1987


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
>
>	alias nd cd \!\$\;set prompt=\`pwd\`\' \'
>
>I hope some else can suggest a more elegant solution for csh


     Try this:


	alias cd 'cd \!*; set prompt=$cwd> '

     The single quotes are important (so's $cwd doesn't get interpreted when
the alias is read, but when it's executed), and the \!* gets around John's
problem about always having to have an argument. Just for completeness, try
these aliases also:

	alias pushd 'pushd \!*; set prompt=$cwd> '
	alias popd 'popd; set prompt=$cwd> '



More information about the Comp.unix.wizards mailing list