prompt changing on the fly

Geoff Walton geoff at ncr-sd.UUCP
Fri Jan 23 01:46:29 AEST 1987


Due to the facts that I have accounts on four (five?) different
machines, and often forget what directory (let alone what
machine) I'm in, I find the following aliases helpful:

alias cd    'cd \!* ; set prompt="[1m\\!:`uuname -l`:[$cwd][0m "'
alias popd	'popd ; set prompt="[1m\\!:`uuname -l`:[$cwd][0m "'
alias pushd 'pushd \!* ; set prompt="[1m\\!:`uuname -l`:[$cwd][0m "'

You might want to remove the escape sequences ([1m and [0m),
as the do nothing but highlight the prompt on my vt 100, but the
resulting prompt gives you:

history#:machine_name:[current_directory]

Ain't no big deal, but it helps.

:r all_usual_disclaimers

Geoff Walton
NCR E&M San Diego
{wherever}!ucbvax!sdcsvax!ncr-sd!geoff
Even the smallest problem becomes unsolvable if enough meetings
are held to discuss it.



More information about the Comp.unix.wizards mailing list