From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12835 invoked by alias); 20 Sep 2011 00:24:26 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16388 Received: (qmail 17121 invoked from network); 20 Sep 2011 00:24:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at herrmann-koenigsberg.de does not designate permitted sender hosts) From: fhml@herrmann-koenigsberg.de To: Message-Id: <25285513.300695.1316475776167.JavaMail.servlet@pustefix152.kundenserver.de> Subject: RE: named jobs in RPROMPT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 X-Binford: 6100 (more power) X-Mailer: Webmail X-Originating-From: 27445976 X-Routing: DE X-Message-Id: <27445976$1316475776118172.23.4.15215739622@pustefix152.kundenserver.de--592815878> X-Received: from pustefix152.kundenserver.de by 217.229.84.181 with HTTP id 27445976 for [zsh-users@zsh.org]; Tue, 20 Sep 2011 01:42:56 CEST Date: Tue, 20 Sep 2011 01:42:56 +0200 X-Provags-ID: V02:K0:H9jleP4X4ejc3a0x71qyq6bKlJRneFyB2dNFLdU4csw D5gJSTq+pjYbWNcuKhkR5ZadjCq3hzAf9zTm02gDv1EmQF6cTQ ZVRBLN+XfDXlgqUIeKNcY0VOZDkmzuDzbgmk0k2HqoeFUne7pT LFzFn/h3SH3sM4d/fjgm5EjLgSpmbqaxiWzU/u6AJfv4/IyCNc C67h4l4ldQ7SX7PIN4R8OV+YNgA3V9Mv+FXNOKWJ1/H6kpPa6N 0yd0gd4/lvIvREv6fDf5zNWPTLBh5OEfHQK8+qiBHz2t+Opjxa 5WThrBsecy++xZzyf4OfqOgjpfw0fMkHluO5KF05mI0keQk5oF gBb5kw5E/cw7mi5XVZL+vu5EkNUdPGd7nbFesseFWSkiaDR3E/ lvGfXLrhn/o7gTatQUFyGJmxdRiAe68RgjnuVcY45vfYFoAseP uf3JV Hey there. > [...] and then set >RPROMPT=$(jobfunction) But I get nothing, it seems jobstates is empty >during prompt generation? When you do >>PROMPT=$(code)<< then 'code' gets executed and the result is stored in PROMPT. Sometimes that is not what you want. What you probably want is >>PROMPT='$(code)'<<. See the little 's? Those prevent 'code' from being evaluated immediately. Now the code gets evaluated every time the PROMPT is shown. A simple example where 'code' is 'date'. Lets say its currently 1970-01-01 00:00:00. When you enter >>PROMPT=$(date)<<, '$(date)' gets evaluated immediately, which is the same as if you typed >>PROMPT="1970-01-01 00:00:00"<<. Of course, that will never change. If you use 's, then '$(date)' gets stored in PROMPT - just as you typed it, not evaluated. Now every time PROMPT is evaluated '$(date)' gets evaluated which gives you a brand new date every time your PROMPT is updated. Greetings :)