about summary refs log tree commit diff
path: root/Doc/Zsh/builtins.yo
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@ipost.com>2021-04-18 13:58:09 -0700
committerBart Schaefer <schaefer@ipost.com>2021-04-18 13:58:09 -0700
commit82ff9f24f170eea7daa935fdaa09ab75a2f277ff (patch)
treecef3fef19fbe032466fcfbe50b7b6aa0878300a5 /Doc/Zsh/builtins.yo
parent56ccb4a975bc87dd10bbbd6a1cfc296d6e2203b4 (diff)
downloadzsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.tar.gz
zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.tar.xz
zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.zip
48560: add TYPESET_TO_UNSET option to remove initialization of parameters
Changes typeset such that ${newparam-notset} yields "notset" and
"typeset -p newparam" does not show an assignment to the parameter.  This
is similar to the default behavior of bash and ksh, with minor differences
in typeset output.

Also add tests for some POSIX incompatibilities plus minor changes for test
harness robustness.
Diffstat (limited to 'Doc/Zsh/builtins.yo')
-rw-r--r--Doc/Zsh/builtins.yo6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index a7afe42cf..61dc6986f 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1872,7 +1872,11 @@ ifnzman(noderef(Local Parameters))\
 retain their special attributes when made local.
 
 For each var(name)tt(=)var(value) assignment, the parameter
-var(name) is set to var(value).
+var(name) is set to var(value).  If the assignment is omitted and var(name)
+does em(not) refer to an existing parameter, a new parameter is intialized
+to empty string, zero, or empty array (as appropriate), em(unless) the
+shell option tt(TYPESET_TO_UNSET) is set.  When that option is set,
+the parameter attributes are recorded but the parameter remains unset.
 
 If the shell option tt(TYPESET_SILENT) is not set, for each remaining
 var(name) that refers to a parameter that is already set, the name and