Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 (Tek) 9/26/83; site zeus.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!tektronix!teklds!zeus!bobr
From: bobr@zeus.UUCP (Robert Reed)
Newsgroups: net.misc
Subject: Re: Funny prompts
Message-ID: <392@zeus.UUCP>
Date: Tue, 16-Oct-84 20:34:47 EDT
Article-I.D.: zeus.392
Posted: Tue Oct 16 20:34:47 1984
Date-Received: Sun, 21-Oct-84 11:19:32 EDT
References: <6040@mcvax.UUCP> <581@gloria.UUCP> <2511@ucbvax.ARPA>
Organization: Tektronix, Beaverton OR
Lines: 26
I have something similar to the prompt that includes cwd, but I couldn't
stand the whole rooted path, so I have the following stuff:
alias setprompt 'set prompt="^[[1;7m`hostname`^[[0m \\!:`echo $cwd | sed -f ~/.home.sed` % "'
alias '>' 'pushd \!* && setprompt'
alias '<' 'popd && setprompt'
alias cd 'cd \!* && setprompt'
where .home.sed is
s:^/usr1/bobr/::
s:^/usr1/bobr$::
s:^/usr./:~:
s:^/usr/spool/news:~news:
s:^/usr/lib/local/emacs:~emacs:
this has the effect of reducing any path below my home directory to just
that partial path, and since all our of our user directories are of the form
'/usr?/', chdir to another user's home directory gives ~user/whatever.
There's also some vt100 garbage so that the hostname is reversed and the
resulting string is something like:
zeus 17:Mail/inbox %
--
Robert Reed, Tektronix Logic Design Systems Division, tektronix!teklds!bobr