Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jul 2000 18:45:59 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        "David J. Kanter" <djkanter@northwestern.edu>
Cc:        FreeBSD questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Setting shell prompt for C-shell
Message-ID:  <20000720184558.T13979@fw.wintelcom.net>
In-Reply-To: <20000720202001.A56906@localhost.localdomain>; from djkanter@northwestern.edu on Thu, Jul 20, 2000 at 08:20:01PM -0500
References:  <20000720202001.A56906@localhost.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
* David J. Kanter <djkanter@northwestern.edu> [000720 18:22] wrote:
> I'm having trouble customizing the shell prompt for csh. I'd like to have:
> 
> pwd % (ex. /home/david % or /usr/bin % ...)
> 
> In my .cshrc I have:
> 
> set prompt="`pwd` % "
> 
> Which works fine upon start-up (/home/david % ) but doesn't change as I make
> my way through various directories. Look...
> 
> /home/david % pwd
> /home/david
> /home/david % cd /usr/ports/distfiles/
> /home/david % pwd                             <---- Not right!
> /usr/ports/distfiles
> /home/david %                                 <---- Not right!
> 
> What did I do wrong?

`pwd` gets evaluated right then and there, not every time you
hit enter, try this instead:

set prompt="%~ >"

Please see the shell's manpage (man csh), in ancient and more
barbaric times someone would show up at your door for forking pwd
every time you hit enter.

tread lightly. :)

-Alfred


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?20000720184558.T13979>