Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Subshells and parameters (was: File locking within zsh?)



On 2006-05-11 16:01:23 +0100, Peter Stephenson wrote:
> "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. [...]

The zshparam man page says:

       $ <S>  The process ID of this shell.

IMHO, it should give more details, e.g.: in subshells, the value
of this parameter is not changed. Ditto for $PPID. Possibly add a
section about subshells in the man pages.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Messages sorted by: Reverse Date, Date, Thread, Author