From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5409 invoked from network); 30 Oct 2001 04:20:57 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?h/D4pxFuWo7lHBwk9DfrlrxKbD90xNun?@203.24.36.3) by ns1.primenet.com.au with SMTP; 30 Oct 2001 04:20:57 -0000 Received: (qmail 9322 invoked from network); 30 Oct 2001 04:20:55 -0000 Received: from sunsite.dk (130.225.247.90) by proxy.melb.primenet.com.au with SMTP; 30 Oct 2001 04:20:55 -0000 Received: (qmail 22830 invoked by alias); 30 Oct 2001 04:20:43 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4439 Received: (qmail 22818 invoked from network); 30 Oct 2001 04:20:43 -0000 Date: Tue, 30 Oct 2001 04:20:41 +0000 To: Le Wang Cc: zsh-users@sunsite.dk Subject: Re: pipe issues with 'jobs' command Message-ID: <20011030042041.B30596@fysh.org> References: <20011029002105.B3832@astaroth.sweth.net> <20011030041449.97914.qmail@web12303.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011030041449.97914.qmail@web12303.mail.yahoo.com> User-Agent: Mutt/1.3.23i From: Zefram Le Wang wrote: >getJobCount () { > print "$#jobtexts"; >} > >prompt_le1_precmd () { > PS1="$(getJobCount) %# " > PS2="%_> " > PS3="?# " >} >-------------- > >If I call getJobCount from the shell directly (e.g. >execute the command 'getJobCount'), I get the real >number of jobs, but my prompt always prints 0. What's >going on here? $() also creates a subshell. You might find psvar and the %v prompt sequence helpful. -zefram