mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-26 04:30:27 +01:00
52325: Clarify doc for edge cases of named references and nofork substitution
Unposted whitespace change avoids a parse error in ${ ... } with comments.
This commit is contained in:
parent
7a84713bb7
commit
fbec213cc5
6 changed files with 25 additions and 13 deletions
|
|
@ -1600,6 +1600,10 @@ example(tt(before local: OUTER)
|
|||
tt(by reference: OUTER)
|
||||
tt(after func: RESULT))
|
||||
|
||||
Note, however, that named references to em(special) parameters acquire
|
||||
the behavior of the special parameter, regardless of the scope where
|
||||
the reference is declared.
|
||||
|
||||
When var(rname) includes an array subscript, the subscript expression
|
||||
is interpreted at the time tt(${)var(pname)tt(}) is expanded. Any
|
||||
form of subscript is allowed, including those that select individual
|
||||
|
|
@ -1929,7 +1933,9 @@ Note that because the `tt(${|)...tt(})' and `tt(${ )...tt( })' forms
|
|||
must be parsed at once as both string tokens and commands, all other
|
||||
braces (`tt({)' or `tt(})') within the command either must be quoted,
|
||||
or must appear in syntactically valid pairs, such as around complex
|
||||
commands, function bodies, or parameter references.
|
||||
commands, function bodies, or parameter references. Furthermore,
|
||||
comments are always recognized, even when tt(NO_INTERACTIVE_COMMENTS)
|
||||
is in effect.
|
||||
|
||||
texinode(Arithmetic Expansion)(Brace Expansion)(Command Substitution)(Expansion)
|
||||
sect(Arithmetic Expansion)
|
||||
|
|
|
|||
|
|
@ -184,13 +184,6 @@ When a function of this name is defined, it is called whenever the
|
|||
parameter var(name) would be unset. The function must explicitly
|
||||
`tt(unset )var(name)', otherwise the variable remains set.
|
||||
|
||||
em(THIS FEATURE IS NOT YET IMPLEMENTED.)
|
||||
)
|
||||
item(tt(${ )var(list)tt(;}))(
|
||||
Note the space after the opening brace (tt({)). This executes var(list)
|
||||
in the current shell and substitutes its standard output in the manner
|
||||
of `tt($LPAR())var(list)tt(RPAR())' but without forking.
|
||||
|
||||
em(THIS FEATURE IS NOT YET IMPLEMENTED.)
|
||||
)
|
||||
item(tt(typeset -C )var(name)[tt(=)var(values)tt( ...)])(
|
||||
|
|
|
|||
|
|
@ -748,9 +748,13 @@ vindex(argv)
|
|||
item(tt(argv) <S> <Z>)(
|
||||
Same as tt(*). Assigning to tt(argv) changes the local positional
|
||||
parameters, but tt(argv) is em(not) itself a local parameter.
|
||||
Deleting tt(argv) with tt(unset) in any function deletes it everywhere,
|
||||
although only the innermost positional parameter array is deleted (so
|
||||
tt(*) and tt(@) in other scopes are not affected).
|
||||
Deleting tt(argv) with tt(unset) in any function deletes it everywhere.
|
||||
This can be avoided by declaring `tt(local +h argv)' before unsetting.
|
||||
Even when not so declared, only the innermost positional parameter
|
||||
array is deleted (so tt(*) and tt(@) in other scopes are not affected).
|
||||
|
||||
A named reference to tt(argv) em(does not) permit a called function to
|
||||
access the positional parameters of its caller.
|
||||
)
|
||||
vindex(@)
|
||||
item(tt(@) <S>)(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue