Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: prompt changing on the fly Message-ID: <5150@mimsy.UUCP> Date: Thu, 22-Jan-87 14:33:26 EST Article-I.D.: mimsy.5150 Posted: Thu Jan 22 14:33:26 1987 Date-Received: Thu, 22-Jan-87 21:45:33 EST References: <410@moncskermit.oz> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 25 (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@moncskermit.oz> john@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@mimsy.umd.edu