From owner-freebsd-questions@FreeBSD.ORG Tue Jul 29 19:00:46 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8FA5106566B for ; Tue, 29 Jul 2008 19:00:46 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id 929F38FC1B for ; Tue, 29 Jul 2008 19:00:46 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from 68-189-244-97.dhcp.oxfr.ma.charter.com ([68.189.244.97] helo=Gregory-Larkins-Computer.local) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1KNuR9-00036i-Qy; Tue, 29 Jul 2008 15:00:45 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by Gregory-Larkins-Computer.local (Postfix) with ESMTP id 001AD22A5BD2; Tue, 29 Jul 2008 15:00:43 -0400 (EDT) Message-ID: <488F68E2.2090409@FreeBSD.org> Date: Tue, 29 Jul 2008 15:00:50 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: FreeBSD Questions , perrin@apotheon.com References: <20080729181904.GA35291@kokopelli.hydra> In-Reply-To: <20080729181904.GA35291@kokopelli.hydra> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.2 (-) Cc: Subject: Re: formatting the time in tcsh prompt X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2008 19:00:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chad Perrin wrote: | This might be slightly off-topic, I suppose -- but since (t)csh is the | default shell for FreeBSD, I figured this might be a good place to ask. | | I'm aware of the %T option for showing 24-hour time in my tcsh prompt, | but it doesn't do exactly what I would like. Inserting a call to the | date command so I can have the exact formatting I want appears to fail by | only calculating the time once, and showing the same time every time the | prompt appears -- which means that, several hours later, I'm still | looking at the time from when the shell instance was started. | | The prompt setting using the date command that I used is as follows: | | set prompt = "[`date +'%H%M'`] %~%# " | ... | There must be some way to do this. Right? | Hi Chad, Right! Try this: set prompt=' % ' alias precmd 'printf "[%s]" "`date +'%H%M'`"' Best regards, Greg - -- Greg Larkin http://www.sourcehosting.net/ http://www.FreeBSD.org/ - The Power To Serve -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIj2ji0sRouByUApARAopEAJ4vVmUZEZ7N+EKPn8fcMAcQGCXlJwCcCrqo pk+1mKZ8Hn63DhZ3qlCWucQ= =hqQT -----END PGP SIGNATURE-----