From owner-freebsd-questions Thu Jul 20 18:46: 2 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 914EF37B790 for ; Thu, 20 Jul 2000 18:45:59 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e6L1jxd27913; Thu, 20 Jul 2000 18:45:59 -0700 (PDT) Date: Thu, 20 Jul 2000 18:45:59 -0700 From: Alfred Perlstein To: "David J. Kanter" Cc: FreeBSD questions Subject: Re: Setting shell prompt for C-shell Message-ID: <20000720184558.T13979@fw.wintelcom.net> References: <20000720202001.A56906@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <20000720202001.A56906@localhost.localdomain>; from djkanter@northwestern.edu on Thu, Jul 20, 2000 at 08:20:01PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * David J. Kanter [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