From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19361 invoked from network); 17 Sep 2006 17:25:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Sep 2006 17:25:17 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 95772 invoked from network); 17 Sep 2006 17:25:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Sep 2006 17:25:10 -0000 Received: (qmail 250 invoked by alias); 17 Sep 2006 17:25:03 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10730 Received: (qmail 240 invoked from network); 17 Sep 2006 17:25:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Sep 2006 17:25:02 -0000 Received: (qmail 94312 invoked from network); 17 Sep 2006 17:25:02 -0000 Received: from smtp4-g19.free.fr (212.27.42.30) by a.mx.sunsite.dk with SMTP; 17 Sep 2006 17:25:02 -0000 Received: from localhost (evr91-1-82-227-12-160.fbx.proxad.net [82.227.12.160]) by smtp4-g19.free.fr (Postfix) with ESMTP id A88B14F3A0 for ; Sun, 17 Sep 2006 19:24:57 +0200 (CEST) Date: Sun, 17 Sep 2006 19:24:58 +0200 From: "arno." To: zsh-users@sunsite.dk Subject: Re: get output of a command in prompt Message-ID: <20060917172458.GA9360@localhost.localdomain> References: <20060916184913.GA18417@localhost.localdomain> <20060916190154.GA24023@fsst.voodoo.lan> <20060917141420.GA5288@localhost.localdomain> <20060917170914.GE55663@dan.emsphone.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: <20060917170914.GE55663@dan.emsphone.com> User-Agent: Mutt/1.5.13 (2006-08-11) --UugvWAfsgieZRqgk Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le Sunday 17 September 2006, =E0 12:09:14PM -0500, Dan a =E9crit :=20 > In the last episode (Sep 17), arno. said: > > Le Saturday 16 September 2006, =E0 21:01:55PM +0200, Frank a =E9crit := =20 > > > arno. : > > > [..get output of command into prompt..] > > >=20 > > > Take a look at this: > > >=20 > > > [snip] > > > zsh% PS1=3D'$(printf "%s: %d" "This is a one" 1)-%% ' > > > $(printf ": /home/hawk" "This is a one" 1)-% setopt promptsubst=20 > > > This is a one: 1-% > > > [snap] > >=20 > > Yes, I've tried things like that, but the problem is that command outpu= t=20 > > will be evaluated once, just when prompt is set up. It will not be=20 > > evaluated each time prompt is displayed >=20 > That example does evalute the prompt each time it's printed; you just > can't tell. Try with a command that changes its output: >=20 > zsh% PS1=3D'$(date)-%% ' ; setopt promptsubst > Sun Sep 17 12:06:02 CDT 2006-% > Sun Sep 17 12:06:33 CDT 2006-% > Sun Sep 17 12:06:34 CDT 2006-%=20 >=20 > Of course in this example you'd be better off using zsh's builtin > date-printing prompt escapes, but you get the idea. Oups, looks like I did it wrong before. It works now thanx a lot arno --UugvWAfsgieZRqgk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFDYTqiH9aBScBsrMRAjY0AJsEBxTgitaZZwOPCCYM4jLJ8X9FSQCgm6eA 329nflnU489fzr7S6jQ338M= =UH1P -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--