From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13705 invoked from network); 11 May 2006 15:01:44 -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.4 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; 11 May 2006 15:01:44 -0000 Received: (qmail 3222 invoked from network); 11 May 2006 15:01:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 May 2006 15:01:37 -0000 Received: (qmail 24549 invoked by alias); 11 May 2006 15:01:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10246 Received: (qmail 24540 invoked from network); 11 May 2006 15:01:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 May 2006 15:01:27 -0000 Received: (qmail 2177 invoked from network); 11 May 2006 15:01:27 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 11 May 2006 15:01:25 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly04d.srv.mailcontrol.com (MailControl) with ESMTP id k4BF1N9b024515 for ; Thu, 11 May 2006 16:01:23 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Thu, 11 May 2006 16:00:42 +0100 Date: Thu, 11 May 2006 16:01:23 +0100 From: Peter Stephenson To: zsh-users@sunsite.dk Subject: Re: File locking within zsh? Message-Id: <20060511160123.29080117.pws@csr.com> In-Reply-To: References: Organization: Cambridge Silicon Radio X-Mailer: Sylpheed version 2.0.4 (GTK+ 2.6.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 May 2006 15:00:42.0327 (UTC) FILETIME=[AC596E70:01C6750B] X-Scanned-By: MailControl A-06-00-05 (www.mailcontrol.com) on 10.68.0.114 "Tim Writer" wrote: > Okay. But I don't understand this: > > tim@ganesh% echo $ZSH_VERSION > 4.2.5 > tim@ganesh% echo $$; ( echo $$ ) > 18095 > 18095 > tim@ganesh% That's standard shell behaviour: $$ is supposed to be unique to the parent shell, not to every subshell instance. You need tricks to get the actual pid. This will work on Linux: zmodload -i zsh/stat stat +link /proc/self getpid() is another thing which could be added to the zsh/system module. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php