Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Subshells and parameters
- X-seq: zsh-users 10270
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Subshells and parameters
- Date: Wed, 17 May 2006 08:42:54 -0700
- In-reply-to: <20060517142404.GS871@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <lt8xp8sko1.fsf@xxxxxxxxxxxxxxxxxx> <20060511160123.29080117.pws@xxxxxxx> <20060512091722.GO4116@xxxxxxxxxxxxxxxxxxx> <87wtcr30nd.fsf@xxxxxxxxxx> <20060512230922.GA871@xxxxxxxxxxxxxxxxxxx> <87ac9m7k7w.fsf@xxxxxxxxxx> <20060517142404.GS871@xxxxxxxxxxxxxxxxxxx>
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 )
Messages sorted by:
Reverse Date,
Date,
Thread,
Author