From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5055 invoked from network); 30 Oct 2001 04:15:13 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?3xmxmCNxjwUTgaZMhIoTkz/aZVQGtJ3f?@203.24.36.3) by ns1.primenet.com.au with SMTP; 30 Oct 2001 04:15:13 -0000 Received: (qmail 9270 invoked from network); 30 Oct 2001 04:15:12 -0000 Received: from sunsite.dk (130.225.247.90) by proxy.melb.primenet.com.au with SMTP; 30 Oct 2001 04:15:12 -0000 Received: (qmail 21827 invoked by alias); 30 Oct 2001 04:14:52 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4438 Received: (qmail 21815 invoked from network); 30 Oct 2001 04:14:51 -0000 Message-ID: <20011030041449.97914.qmail@web12303.mail.yahoo.com> Date: Mon, 29 Oct 2001 23:14:49 -0500 (EST) From: Le Wang Subject: Re: pipe issues with 'jobs' command To: zsh-users@sunsite.dk In-Reply-To: <20011029002105.B3832@astaroth.sweth.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii --- Sweth Chandramouli wrote: > On Sun, Oct 28, 2001 at 08:37:48PM -0500, Le Wang > wrote: > > Pretty weird, eh? > Not really; this is the expected behaviour. This > was > just discussed in another thread earlier this month; > search the archives > for the thread "get the number of active jobs to > show in the prompt?". > > -- Sweth. > > -- > Sweth Chandramouli ; > President, Idiopathic Systems Consulting okay, thanks a lot. That's really helpful. So a subshell was being created on the lhs of the pipe...that makes sense. But looking at the following code from my .zshrc: -------------- 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? thanks -lw _______________________________________________________ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca