Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: File locking within zsh?
- X-seq: zsh-users 10246
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: File locking within zsh?
- Date: Thu, 11 May 2006 16:01:23 +0100
- In-reply-to: <lt8xp8sko1.fsf@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <lt8xp8sko1.fsf@xxxxxxxxxxxxxxxxxx>
"Tim Writer" <tim@xxxxxxxxxxx> 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 <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author