Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 1999 17:54:19 -0600 (MDT)
From:      Jonathon Doran <doranj@Colorado.EDU>
To:        trzy@powernet.net (Bart Trzynadlowski)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: prompts
Message-ID:  <199906102354.RAA07500@ucsu.Colorado.EDU>
In-Reply-To: <Pine.BSF.4.05.9906101615410.393-100000@Brzuszek> from "Bart Trzynadlowski" at Jun 10, 99 04:20:37 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 	Csh is for my root account and when I logged in as root I got to
> experience what follows:
> 
> /root# cd ..
> /root# cd /home/trzy
> /root#

Well, from the comp.unix.questions FAQ:  (for csh)

           alias setprompt 'set prompt="${cwd}% "'
           setprompt          # to set the initial prompt
           alias cd 'chdir \!* && setprompt'

The same type of strategy can work for other shells.  The problem with
what you were attempting is that shell variables are evaluated when they
are created.  So your first directory was loaded into the variable, and the
expression wasn't re-evaluated later.  If you change cd (as above) you can
have it re-evaluate this expression.

Jon Doran


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906102354.RAA07500>