Skip to content

Commit

Permalink
48888: improve doc for $$ and $PPID, add fail test for PPID readonly-…
Browse files Browse the repository at this point in the history
…ness
  • Loading branch information
bart-schaefer committed Sep 6, 2021
1 parent c0e5b21 commit a31fd30
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,5 +1,8 @@
2021-09-06 Bart Schaefer <schaefer@zsh.org>

* 48888: Doc/Zsh/mod_system.yo, Doc/Zsh/params.yo, Test/E03posix.ztst:
improve doc for $$ and $PPID, add fail test for PPID readonly-ness

* 48832: Completion/Unix/Type/_urls: try _gnu_generic first

2021-09-04 Oliver Kiddle <opk@zsh.org>
Expand Down
6 changes: 3 additions & 3 deletions Doc/Zsh/mod_system.yo
Expand Up @@ -263,9 +263,9 @@ tt($$), which returns the process ID of the main shell process.
)
item(tt(ppid))(
vindex(ppid, sysparams)
Returns the process ID of the parent of the current process, even in
subshells. Compare tt($PPID), which returns the process ID of the parent
of the main shell process.
Returns the current process ID of the parent of the current process, even
in subshells. Compare tt($PPID), which returns the process ID of the
initial parent of the main shell process.
)
item(tt(procsubstpid))(
Returns the process ID of the last process started for process
Expand Down
15 changes: 8 additions & 7 deletions Doc/Zsh/params.yo
Expand Up @@ -654,10 +654,11 @@ Same as tt(#).
)
vindex($)
item(tt($) <S>)(
The process ID of this shell. Note that this indicates the original
shell started by invoking tt(zsh); all processes forked from the shells
without executing a new program, such as subshells started by
tt(LPAR())var(...)tt(RPAR()), substitute the same value.
The process ID of this shell, set when the shell initializes. Processes
forked from the shell without executing a new program, such as command
substitutions and commands grouped with tt(LPAR())var(...)tt(RPAR()),
are subshells that duplicate the current shell, and thus substitute the
same value for tt($$) as their parent shell.
)
vindex(-)
item(tt(-) <S>)(
Expand Down Expand Up @@ -817,9 +818,9 @@ The operating system, as determined at compile time.
)
vindex(PPID)
item(tt(PPID) <S>)(
The process ID of the parent of the shell. As for tt($$), the
value indicates the parent of the original shell and does not
change in subshells.
The process ID of the parent of the shell, set when the shell initializes.
As with tt($$), the value does not change in subshells created as a
duplicate of the current shell.
)
vindex(PWD)
item(tt(PWD))(
Expand Down
3 changes: 3 additions & 0 deletions Test/E03posix.ztst
Expand Up @@ -161,3 +161,6 @@ F:POSIX has neither math functions nor floating point
0f:Width of %s is computed in bytes not characters
F:This is considered a bugfix in zsh
>< Stéphane>

PPID=foo
-f:PPID is not a readonly variable

0 comments on commit a31fd30

Please sign in to comment.