From owner-freebsd-questions Thu Jun 10 16:54:26 1999 Delivered-To: freebsd-questions@freebsd.org Received: from ucsu.Colorado.EDU (ucsu.Colorado.EDU [128.138.129.83]) by hub.freebsd.org (Postfix) with ESMTP id 48CFF14C41 for ; Thu, 10 Jun 1999 16:54:23 -0700 (PDT) (envelope-from doranj@ucsu.Colorado.EDU) Received: (from doranj@localhost) by ucsu.Colorado.EDU (8.9.3/8.9.3/ITS-5.0/standard) id RAA07500; Thu, 10 Jun 1999 17:54:19 -0600 (MDT) From: Jonathon Doran Message-Id: <199906102354.RAA07500@ucsu.Colorado.EDU> Subject: Re: prompts To: trzy@powernet.net (Bart Trzynadlowski) Date: Thu, 10 Jun 1999 17:54:19 -0600 (MDT) Cc: freebsd-questions@freebsd.org In-Reply-To: from "Bart Trzynadlowski" at Jun 10, 99 04:20:37 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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