From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24151 invoked from network); 17 May 2006 15:44:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 May 2006 15:44:01 -0000 Received: (qmail 89320 invoked from network); 17 May 2006 15:43:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 May 2006 15:43:55 -0000 Received: (qmail 25261 invoked by alias); 17 May 2006 15:43:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10270 Received: (qmail 25252 invoked from network); 17 May 2006 15:43:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 May 2006 15:43:47 -0000 Received: (qmail 88231 invoked from network); 17 May 2006 15:43:47 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 17 May 2006 15:43:46 -0000 Received: from torch.brasslantern.com ([71.116.105.50]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IZF00LK02BJ7S05@vms044.mailsrvcs.net> for zsh-users@sunsite.dk; Wed, 17 May 2006 10:42:55 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k4HFgslb008382 for ; Wed, 17 May 2006 08:42:54 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k4HFgsTT008381 for zsh-users@sunsite.dk; Wed, 17 May 2006 08:42:54 -0700 Date: Wed, 17 May 2006 08:42:54 -0700 From: Bart Schaefer Subject: Re: Subshells and parameters In-reply-to: <20060517142404.GS871@prunille.vinc17.org> To: zsh-users@sunsite.dk Message-id: <060517084254.ZM8380@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20060511160123.29080117.pws@csr.com> <20060512091722.GO4116@prunille.vinc17.org> <87wtcr30nd.fsf@asfast.com> <20060512230922.GA871@prunille.vinc17.org> <87ac9m7k7w.fsf@asfast.com> <20060517142404.GS871@prunille.vinc17.org> Comments: In reply to Vincent Lefevre "Re: Subshells and parameters" (May 17, 4:24pm) On May 17, 4:24pm, Vincent Lefevre wrote: } Subject: Re: Subshells and parameters } } On 2006-05-12 22:05:23 -0400, Lloyd Zusman wrote: } > I'm wondering if there's a solution that doesn't require a separate } > executable. } } You need a module, but this isn't implemented yet. As someone pointed out earlier, you can fork a new copy of zsh to find this information; to split hairs, that's a separate process, but not a separate executable. Example: getpid() { typeset -g PID=$(exec $ZSH_NAME -fc 'print $PPID') } The exec is important, otherwise you spawn two processes and get the PID of the intermediate descendant. Compare: getpid; print $$ $PID ( getpid; print $$ $PID )