1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

35034: improve manual format up to Chapter18

This commit is contained in:
Jun-ichi Takimoto 2015-05-06 10:45:21 +09:00
parent 3c3c8d3d13
commit 36a55e278e
10 changed files with 269 additions and 254 deletions

View file

@ -1,3 +1,7 @@
2015-05-06 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 35034: improve format in the manual (up to Chapter18)
2015-05-05 Peter Stephenson <p.w.stephenson@ntlworld.com>
* unposted: Config/version.mk, Etc/FAQ.yo: update for

View file

@ -7,7 +7,8 @@ cindex(arithmetic evaluation)
cindex(evaluation, arithmetic)
findex(let, use of)
The shell can perform integer and floating point arithmetic, either using
the builtin tt(let), or via a substitution of the form tt($((...))). For
the builtin tt(let), or via a substitution of the form
tt($LPAR()LPAR())var(...)tt(RPAR()RPAR()). For
integers, the shell is usually compiled to use 8-byte precision where this
is available, otherwise precision is 4 bytes. This can be tested, for
example, by giving the command `tt(print - $(( 12345678901 )))'; if the
@ -40,7 +41,7 @@ cindex(arithmetic base)
cindex(bases, in arithmetic)
Integers can be in bases other than 10.
A leading `tt(0x)' or `tt(0X)' denotes hexadecimal and a leading
`tt(0b)' or `tt(0B) binary.
`tt(0b)' or `tt(0B)' binary.
Integers may also be of the form `var(base)tt(#)var(n)',
where var(base) is a decimal number between two and thirty-six
representing the arithmetic base and var(n)
@ -100,8 +101,8 @@ shown may vary).
pindex(C_BASES, use of)
pindex(OCTAL_ZEROES, use of)
If the tt(C_BASES) option is set, hexadecimal numbers in the standard C
format, for example tt(0xFF) instead of the usual `tt(16#FF)'. If the
If the tt(C_BASES) option is set, hexadecimal numbers are output in the standard C
format, for example `tt(0xFF)' instead of the usual `tt(16#FF)'. If the
option tt(OCTAL_ZEROES) is also set (it is not by default), octal numbers
will be treated similarly and hence appear as `tt(077)' instead of
`tt(8#77)'. This option has no effect on the output of bases other than
@ -175,7 +176,7 @@ endsitem()
Note the precedence of exponentiation in both cases is below
that of unary operators, hence `tt(-3**2)' evaluates as `tt(9)', not
tt(-9). Use parentheses where necessary: `tt(-(3**2))'. This is
`tt(-9)'. Use parentheses where necessary: `tt(-(3**2))'. This is
for compatibility with other shells.
cindex(mathematical functions, use of)
@ -190,12 +191,12 @@ functions.
An expression of the form `tt(##)var(x)' where var(x) is any character
sequence such as `tt(a)', `tt(^A)', or `tt(\M-\C-x)' gives the value of
this character and an expression of the form `tt(#)var(foo)' gives the
value of the first character of the contents of the parameter var(foo).
this character and an expression of the form `tt(#)var(name)' gives the
value of the first character of the contents of the parameter var(name).
Character values are according to the character set used in the current
locale; for multibyte character handling the option tt(MULTIBYTE) must be
set. Note that this form is different from `tt($#)var(foo)', a standard
parameter substitution which gives the length of the parameter var(foo).
set. Note that this form is different from `tt($#)var(name)', a standard
parameter substitution which gives the length of the parameter var(name).
`tt(#\)' is accepted instead of `tt(##)', but its use is deprecated.
Named parameters and subscripted arrays can be referenced by name within an

View file

@ -5,7 +5,8 @@ sect(Shell Builtin Commands)
)\
def(prefix)(1)(\
item(tt(ARG1) var(simple command))(
See noderef(Precommand Modifiers).
See ifzman(the section `Precommand Modifiers' in zmanref(zshmisc))\
ifnzman(noderef(Precommand Modifiers)).
)\
)\
def(alias)(2)(\
@ -95,7 +96,7 @@ which may have effects on shell parameters. A zero exit status is returned.
findex(alias)
cindex(aliases, defining)
cindex(aliases, listing)
item(tt(alias) [ {tt(PLUS()|tt(-))}tt(gmrsL) ] [ var(name)[tt(=)var(value)] ... ])(
item(tt(alias) [ {tt(PLUS())|tt(-)}tt(gmrsL) ] [ var(name)[tt(=)var(value)] ... ])(
For each var(name) with a corresponding var(value), define an alias
with that value. A trailing space in var(value) causes the next word
to be checked for alias expansion. If the tt(-g) flag is present,
@ -135,8 +136,8 @@ alias in a manner suitable for putting in a startup script. The exit
status is nonzero if a var(name) (with no var(value)) is given for
which no alias has been defined.
For more on aliases, include common problems,
ifzman(see the section ALIASING in zmanref(zshmisc))\
For more on aliases, include common problems, see
ifzman(the section ALIASING in zmanref(zshmisc))\
ifnzman(noderef(Aliasing)).
)
findex(autoload)
@ -273,7 +274,8 @@ searched instead of that in tt($path). With the tt(-v) flag, tt(command)
is similar to tt(whence) and with tt(-V), it is equivalent to tt(whence
-v).
See also noderef(Precommand Modifiers).
See also ifzman(the section `Precommand Modifiers' in zmanref(zshmisc))\
ifnzman(noderef(Precommand Modifiers)).
)
module(comparguments)(zsh/computil)
module(compcall)(zsh/compctl)
@ -353,7 +355,7 @@ setting here. For example, if tt(EXTENDED_GLOB) is not active,
the pattern tt(^) is ineffective even if `tt(disable -p "^")' has
not been issued. The list below indicates any option settings
that restrict the use of the pattern. It should be noted that
setting tt(SH_GLOB) has a wider effect then merely disabling patterns
setting tt(SH_GLOB) has a wider effect than merely disabling patterns
as certain expressions, in particular those involving parentheses,
are parsed differently.
@ -361,6 +363,7 @@ The following patterns may be disabled; all
the strings need quoting on the command line to prevent them from
being interpreted immediately as patterns and the patterns are
shown below in single quotes as a reminder.
startitem()
item(tt('?'))(
The pattern character tt(?) wherever it occurs, including when preceding
@ -370,7 +373,7 @@ item(tt('*'))(
The pattern character tt(*) wherever it occurs, including recursive
globbing and when preceding a parenthesis with tt(KSH_GLOB).
)
item('LSQUARE()')(
item(tt('LSQUARE()'))(
Character classes.
)
item(tt('<') (tt(NO_SH_GLOB)))(
@ -615,12 +618,14 @@ the same as if the commands had been executed directly by the shell;
if there are no var(args) or they contain no commands (i.e. are
an empty string or whitespace) the return status is zero.
)
item(tt(exec) [ tt(-cl) ] [ tt(-a) var(argv0) ] [ var(command) [ var(arg) ... ]])(
item(tt(exec) [ tt(-cl) ] [ tt(-a) var(argv0) ] [ var(command) [ var(arg) ... ] ])(
Replace the current shell with an external var(command) rather than forking.
With tt(-c) clear the environment; with tt(-l) prepend tt(-) to the
tt(argv[0]) string of the command executed (to simulate a login shell);
with tt(-a) var(argv0) set the tt(argv[0]) string of the command
executed. See noderef(Precommand Modifiers).
executed.
See ifzman(the section `Precommand Modifiers' in zmanref(zshmisc))\
ifnzman(noderef(Precommand Modifiers)).
cindex(redirection, current shell's I/O)
If var(command) is omitted but any redirections are specified,
@ -775,13 +780,13 @@ Bring each specified var(job) in turn to the foreground.
If no var(job) is specified, resume the current job.
)
findex(float)
item(tt(float) [ {tt(PLUS())|tt(-)}tt(EFHghlprtux) ] [ tt(-LRZ) [ var(n) ]] \
[ var(name)[tt(=)var(value)] ... ])(
item(tt(float) [ {tt(PLUS())|tt(-)}tt(Hghlprtux) ] \
[ {tt(PLUS())|tt(-)}tt(EFLRZ) [ var(n) ] ] [ var(name)[tt(=)var(value)] ... ])(
Equivalent to tt(typeset -E), except that options irrelevant to floating
point numbers are not permitted.
)
findex(functions)
xitem(tt(functions) [ {tt(PLUS())|tt(-)}tt(UXkmtTuz) ] [ var(name) ... ])
xitem(tt(functions) [ {tt(PLUS())|tt(-)}tt(UkmtTuz) ] [ var(name) ... ])
xitem(tt(functions -M) var(mathfn) [ var(min) [ var(max) [ var(shellfn) ] ] ])
xitem(tt(functions -M) [ tt(-m) var(pattern) ... ])
item(tt(functions +M) [ tt(-m) ] var(mathfn) ... )(
@ -834,7 +839,7 @@ cindex(line, reading)
cindex(reading a line)
item(tt(getln) [ tt(-AclneE) ] var(name) ...)(
Read the top value from the buffer stack and put it in
the shell parameter tt(name). Equivalent to
the shell parameter var(name). Equivalent to
tt(read -zr).
)
findex(getopts)
@ -922,8 +927,8 @@ the form of a call to hash.
)
alias(history)(fc -l)
findex(integer)
item(tt(integer) [ {tt(PLUS())|tt(-)}tt(Hghilprtux) ] \
[ tt(-LRZ) [ var(n) ]] [ var(name)[tt(=)var(value)] ... ])(
item(tt(integer) [ {tt(PLUS())|tt(-)}tt(Hghlprtux) ] \
[ {tt(PLUS())|tt(-)}tt(LRZi) [ var(n) ] ] [ var(name)[tt(=)var(value)] ... ])(
Equivalent to tt(typeset -i), except that options irrelevant to
integers are not permitted.
)
@ -1058,8 +1063,8 @@ shell starts in a mode emulating another shell. It can be made available
with the command `tt(zmodload -F zsh/rlimits b:limit)'.
)
findex(local)
item(tt(local) [ {tt(PLUS())|tt(-)}tt(AEFHUahlprtux) ] \
[ tt(-LRZi) [ var(n) ]] [ var(name)[tt(=)var(value)] ] ...)(
item(tt(local) [ {tt(PLUS())|tt(-)}tt(AHUahlprtux) ] \
[ {tt(PLUS())|tt(-)}tt(EFLRZi) [ var(n) ] ] [ var(name)[tt(=)var(value)] ... ])(
Same as tt(typeset), except that the options tt(-g), and
tt(-f) are not permitted. In this case the tt(-x) option does not force
the use of tt(-g), i.e. exported variables will be local to functions.
@ -1078,12 +1083,12 @@ Same as tt(exit), except that it only works in a login shell.
)
prefix(noglob)
findex(popd)
item(tt(popd) [ [-q] {tt(PLUS())|tt(-)}var(n) ])(
item(tt(popd) [ tt(-q) ] [ {tt(PLUS())|tt(-)}var(n) ])(
Remove an entry from the directory stack, and perform a tt(cd) to
the new top directory. With no argument, the current top entry is
removed. An argument of the form `tt(PLUS())var(n)' identifies a stack
entry by counting from the left of the list shown by the tt(dirs) command,
starting with zero. An argument of the form tt(-n) counts from the right.
starting with zero. An argument of the form tt(-)var(n) counts from the right.
pindex(PUSHD_MINUS, use of)
If the tt(PUSHD_MINUS) option is set, the meanings of `tt(PLUS())' and
`tt(-)' in this context are swapped.
@ -1117,7 +1122,7 @@ tt(-c) and tt(-C) options.
item(tt(-b))(
Recognize all the escape sequences defined for the tt(bindkey) command,
see
ifzman(zmanref(zshzle))\
ifzman(the section `Zle Builtins' in zmanref(zshzle))\
ifnzman(noderef(Zle Builtins))\
.
)
@ -1204,13 +1209,13 @@ item(tt(printf) var(format) [ var(arg) ... ])(
Print the arguments according to the format specification. Formatting
rules are the same as used in C. The same escape sequences as for tt(echo)
are recognised in the format. All C conversion specifications ending in
one of csdiouxXeEfgGn are handled. In addition to this, `tt(%b)' can be
one of tt(csdiouxXeEfgGn) are handled. In addition to this, `tt(%b)' can be
used instead of `tt(%s)' to cause escape sequences in the argument to be
recognised and `tt(%q)' can be used to quote the argument in such a way
that allows it to be reused as shell input. With the numeric format
specifiers, if the corresponding argument starts with a quote character,
the numeric value of the following character is used as the number to
print otherwise the argument is evaluated as an arithmetic expression. See
print; otherwise the argument is evaluated as an arithmetic expression. See
ifzman(the section `Arithmetic Evaluation' in zmanref(zshmisc))\
ifnzman(noderef(Arithmetic Evaluation))
for a description of arithmetic
@ -1487,7 +1492,7 @@ module(setcap)(zsh/cap)
findex(setopt)
cindex(options, setting)
item(tt(setopt) [ {tt(PLUS())|tt(-)}var(options) | \
{tt(PLUS())|tt(-)}tt(o) var(option_name) ] [ var(name) ... ])(
{tt(PLUS())|tt(-)}tt(o) var(option_name) ] [ tt(-m) ] [ var(name) ... ])(
Set the options for the shell. All options specified either
with flags or by name are set.
@ -1653,7 +1658,7 @@ Do nothing and return an exit status of 0.
)
findex(ttyctl)
cindex(tty, freezing)
item(tt(ttyctl) tt(-fu))(
item(tt(ttyctl) [ tt(-fu) ])(
The tt(-f) option freezes the tty (i.e. terminal or terminal emulator), and
tt(-u) unfreezes it.
When the tty is frozen, no changes made to the tty settings by
@ -1682,12 +1687,12 @@ Equivalent to tt(whence -v).
findex(typeset)
cindex(parameters, setting)
cindex(parameters, declaring)
xitem(tt(typeset) [ {tt(PLUS())|tt(-)}tt(AEFHUafghklprtuxmz) ] [ tt(-LRZi) \
[ var(n) ]] [ \
var(name)[tt(=)var(value)] ... ])
item(tt(typeset) -T [ {tt(PLUS()|tt(-))}tt(Urux) ] \
[ tt(-LRZ) [ var(n) ]] \
var(SCALAR)[tt(=)var(value)] var(array) tt([) var(sep) tt(]))(
xitem(tt(typeset) [ {tt(PLUS())|tt(-)}tt(AHUaghlmprtux) ] \
[ {tt(PLUS())|tt(-)}tt(EFLRZi) [ var(n) ] ])
xitem( [ tt(+) | var(name)[tt(=)var(value)] ... ])
xitem(tt(typeset) tt(-T) [ {tt(PLUS())|tt(-)}tt(Uglprux) ] [ {tt(PLUS())|tt(-)}tt(LRZ) [ var(n) ] ])
xitem( [ tt(+) | var(SCALAR)[tt(=)var(value)] var(array) [ var(sep) ] ])
item(tt(typeset) tt(-f) [ {tt(PLUS())|tt(-)}tt(TUkmtuz) ] [ tt(+) | var(name) ... ])(
Set or display attributes and values for shell parameters.
A parameter is created for each var(name) that does not already refer
@ -1811,7 +1816,7 @@ as before but the separator is changed.
enditem()
Attribute flags that transform the final value (tt(-L), tt(-R), tt(-Z),
tt(-l), tt(u)) are only applied to the expanded value at the point
tt(-l), tt(-u)) are only applied to the expanded value at the point
of a parameter expansion expression using `tt($)'. They are not applied
when a parameter is retrieved internally by the shell for any purpose.
@ -1824,8 +1829,9 @@ ifzman(`Array Parameters' in zmanref(zshparam))\
ifnzman(noderef(Array Parameters))\
.
)
item(tt(-L))(
Left justify and remove leading blanks from var(value).
item(tt(-L) [ var(n) ])(
Left justify and remove leading blanks from the value when the parameter
is expanded.
If var(n) is nonzero, it defines the width of the field.
If var(n) is zero, the width is determined by the width of the value of
the first assignment. In the case of numeric parameters, the length of the
@ -1845,7 +1851,7 @@ blanks or truncated if necessary to fit the field.
Note truncation can lead to unexpected results with numeric parameters.
Leading zeros are removed if the tt(-Z) flag is also set.
)
item(tt(-R))(
item(tt(-R) [ var(n) ])(
Similar to tt(-L), except that right justification is used;
when the parameter is expanded, the field is left filled with
blanks or truncated from the end. May not be combined with the tt(-Z)
@ -1857,7 +1863,7 @@ occurrence of each duplicated value. This may also be set for
colon-separated special parameters like tt(PATH) or tt(FIGNORE), etc.
This flag has a different meaning when used with tt(-f); see below.
)
item(tt(-Z))(
item(tt(-Z) [ var(n) ])(
Specially handled if set along with the tt(-L) flag.
Otherwise, similar to tt(-R), except that leading zeros are used for
padding instead of blanks if the first non-blank character is a digit.
@ -1884,7 +1890,7 @@ parameter will be searched to find the function definition when the
function is first referenced; see noderef(Functions). The tt(-k) and
tt(-z) flags make the function be loaded using ksh-style or zsh-style
autoloading respectively. If neither is given, the setting of the
KSH_AUTOLOAD option determines how the function is loaded.
tt(KSH_AUTOLOAD) option determines how the function is loaded.
)
item(tt(-h))(
Hide: only useful for special parameters (those marked `<S>' in the table in
@ -1914,18 +1920,18 @@ default for the parameters in the tt(zsh/parameter) and tt(zsh/mapfile)
modules. Note, however, that unlike the tt(-h) flag this is also useful
for non-special parameters.
)
item(tt(-i))(
item(tt(-i) [ var(n) ])(
Use an internal integer representation. If var(n) is nonzero it
defines the output arithmetic base, otherwise it is determined by the
first assignment. Bases from 2 to 36 inclusive are allowed.
)
item(tt(-E))(
item(tt(-E) [ var(n) ])(
Use an internal double-precision floating point representation. On output
the variable will be converted to scientific notation. If var(n) is
nonzero it defines the number of significant figures to display; the
default is ten.
)
item(tt(-F))(
item(tt(-F) [ var(n) ])(
Use an internal double-precision floating point representation. On output
the variable will be converted to fixed-point decimal notation. If var(n)
is nonzero it defines the number of digits to display after the decimal
@ -1968,7 +1974,7 @@ enditem()
findex(ulimit)
cindex(resource limits)
cindex(limits, resource)
item(tt(ulimit) [ [ tt(-SHacdfiklmnpqsTtvwx) | tt(-N) var(resource) [ var(limit) ] ... ])(
item(tt(ulimit) [ tt(-HSa) ] [ { tt(-bcdfiklmnpqrsTtvwx) | tt(-N) var(resource) } [ var(limit) ] ... ])(
Set or display resource limits of the shell and the processes started by
the shell. The value of var(limit) can be a number in the unit specified
below or one of the values `tt(unlimited)', which removes the limit on the
@ -2132,7 +2138,7 @@ to process IDs.
)
findex(whence)
item(tt(whence) [ tt(-vcwfpamsS) ] var(name) ...)(
For each name, indicate how it would be interpreted if used as a
For each var(name), indicate how it would be interpreted if used as a
command name.
tt(whence) is most useful when var(name) is only the last path component
@ -2334,7 +2340,7 @@ findex(zmodload)
cindex(modules, loading)
cindex(loading modules)
xitem(tt(zmodload) [ tt(-dL) ] [ ... ])
xitem(tt(zmodload -F) [ tt(-lLme) tt(-P) tt(param) ] var(module) [tt(PLUS()-)]var(feature...))
xitem(tt(zmodload -F) [ tt(-alLme) tt(-P) var(param) ] var(module) [ [tt(PLUS()-)]var(feature) ... ])
xitem(tt(zmodload -e) [ tt(-A) ] [ ... ])
xitem(tt(zmodload) [ tt(-a) [ tt(-bcpf) [ tt(-I) ] ] ] [ tt(-iL) ] ...)
xitem(tt(zmodload) tt(-u) [ tt(-abcdpf) [ tt(-I) ] ] [ tt(-iL) ] ...)
@ -2385,7 +2391,7 @@ Each module has a boot and a cleanup function. The module
will not be loaded if its boot function fails. Similarly a module
can only be unloaded if its cleanup function runs successfully.
)
item(tt(zmodload -F) [ tt(-almLe) tt(-P) tt(param) ] var(module) [tt(PLUS()-)]var(feature...))(
item(tt(zmodload -F) [ tt(-almLe) tt(-P) var(param) ] var(module) [ [tt(PLUS()-)]var(feature) ... ])(
tt(zmodload -F) allows more selective control over the features provided
by modules. With no options apart from tt(-F), the module named
var(module) is loaded, if it was not already loaded, and the list of
@ -2416,7 +2422,7 @@ feature per line. With tt(-L) alone, a tt(zmodload -F) command that would
cause enabled features of the module to be turned on is shown. With
tt(-lL), a tt(zmodload -F) command that would cause all the features to be
set to their current state is shown. If one of these combinations is given
the option tt(-P) var(param) then the parameter tt(param) is set to an
with the option tt(-P) var(param) then the parameter var(param) is set to an
array of features, either features together with their state or (if
tt(-L) alone is given) enabled features.

View file

@ -123,7 +123,7 @@ tt(MATCH) is set to the substring that matched the pattern and
the integer parameters tt(MBEGIN) and tt(MEND) to the index of the start
and end, respectively, of the match in var(string), such that if
var(string) is contained in variable tt(var) the expression
`${var[$MBEGIN,$MEND]}' is identical to `$MATCH'. The setting
`tt(${var[$MBEGIN,$MEND]})' is identical to `tt($MATCH)'. The setting
of the option tt(KSH_ARRAYS) is respected. Likewise, the array
tt(match) is set to the substrings that matched parenthesised
subexpressions and the arrays tt(mbegin) and tt(mend) to the indices of
@ -132,9 +132,9 @@ var(string). The arrays are not set if there were no parenthesised
subexpresssions. For example, if the string `tt(a short string)' is matched
against the regular expression `tt(s+LPAR()...RPAR()t)', then (assuming the
option tt(KSH_ARRAYS) is not set) tt(MATCH), tt(MBEGIN)
and tt(MEND) are `tt(short)', 3 and 7, respectively, while tt(match),
and tt(MEND) are `tt(short)', tt(3) and tt(7), respectively, while tt(match),
tt(mbegin) and tt(mend) are single entry arrays containing
the strings `tt(hor)', `tt(4)' and `tt(6), respectively.
the strings `tt(hor)', `tt(4)' and `tt(6)', respectively.
If the option tt(BASH_REMATCH) is set the array
tt(BASH_REMATCH) is set to the substring that matched the pattern
@ -216,7 +216,7 @@ test command.
For example,
tt([[ -n file*(#qN) ]])
example([[ -n file*(#qN) ]])
produces status zero if and only if there is at least one file in the
current directory beginning with the string `tt(file)'. The globbing
@ -243,7 +243,8 @@ even if the underlying system does not support
the tt(/dev/fd) directory.
In the forms which do numeric comparison, the expressions var(exp)
undergo arithmetic expansion as if they were enclosed in tt($((...))).
undergo arithmetic expansion as if they were enclosed in
tt($LPAR()LPAR())var(...)tt(RPAR()RPAR()).
For example, the following:

View file

@ -943,7 +943,7 @@ item(tt(F))(
Join the words of arrays together using newline as a separator.
This is a shorthand for `tt(pj:\n:)'.
)
item(tt(g:opts:))(
item(tt(g:)var(opts)tt(:))(
Process escape sequences like the echo builtin when no options are given
(tt(g::)). With the tt(o) option, octal escapes don't take a leading
zero. With the tt(c) option, sequences like `tt(^X)' are also processed.
@ -1168,11 +1168,11 @@ optional; neither, the first, or both may be given. Note that the same
pairs of delimiters must be used for each of the three arguments. The
space to the left will be filled with var(string1) (concatenated as
often as needed) or spaces if var(string1) is not given. If both
var(string1) and var(string2) are given, tt(string2) is inserted once
var(string1) and var(string2) are given, var(string2) is inserted once
directly to the left of each word, truncated if necessary, before
var(string1) is used to produce any remaining padding.
If either of var(string1) or tt(string2) is present but empty,
If either of var(string1) or var(string2) is present but empty,
i.e. there are two delimiters together at that point, the first
character of tt($IFS) is used instead.
@ -1230,7 +1230,7 @@ example(line="one::three"
print -l "${(s.:.)line}")
produces two lines of output for tt(one) and tt(three) and elides the
empty field. To override this behaviour, supply the "(@)" flag as well,
empty field. To override this behaviour, supply the `tt((@))' flag as well,
i.e. tt("${(@s.:.)line}").
)
item(tt(Z:)var(opts)tt(:))(
@ -1314,14 +1314,14 @@ enditem()
subsect(Rules)
Here is a summary of the rules for substitution; this assumes that braces
are present around the substitution, i.e. tt(${...}). Some particular
are present around the substitution, i.e. tt(${)var(...)tt(}). Some particular
examples are given below. Note that the Zsh Development Group accepts
em(no responsibility) for any brain damage which may occur during the
reading of the following rules.
startitem()
item(tt(1.) em(Nested substitution))(
If multiple nested tt(${...}) forms are present, substitution is
If multiple nested tt(${)var(...)tt(}) forms are present, substitution is
performed from the inside outwards. At each level, the substitution takes
account of whether the current value is a scalar or an array, whether the
whole substitution is in double quotes, and what flags are supplied to the
@ -2233,7 +2233,7 @@ tt(readme) with up to two errors.
When using the ksh syntax for grouping both tt(KSH_GLOB) and
tt(EXTENDED_GLOB) must be set and the left parenthesis should be
preceded by tt(@). Note also that the flags do not affect letters
inside tt([...]) groups, in other words tt(LPAR()#i)tt(RPAR()[a-z])
inside tt([)...tt(]) groups, in other words tt(LPAR()#i)tt(RPAR()[a-z])
still matches only lowercase letters. Finally, note that when
examining whole paths case-insensitively every directory must be
searched for all files which match, so that a pattern of the form
@ -2344,7 +2344,8 @@ the glob pattern by doubling the parentheses, in this case producing
`tt(((^x)))'.
If the option tt(EXTENDED_GLOB) is set, a different syntax for glob
qualifiers is available, namely `tt((#qx))' where tt(x) is any of the same
qualifiers is available, namely `tt(LPAR()#q)var(x)tt(RPAR())'
where var(x) is any of the same
glob qualifiers used in the other format. The qualifiers must still appear
at the end of the pattern. However, with this syntax multiple glob
qualifiers may be chained together. They are treated as a logical AND of
@ -2357,7 +2358,7 @@ the pattern, for example `tt(*(#q*)(.))' will recognise executable regular
files if both options are set; however, mixed syntax should probably be
avoided for the sake of clarity. Note that within conditions using the
`tt([[)' form the presence of a parenthesised expression
tt(LPAR()#q...+RPAR()) at the end of a string indicates that globbing
tt(LPAR()#q)var(...)tt(RPAR()) at the end of a string indicates that globbing
should be performed; the expression may include glob qualifiers, but
it is also valid if it is simply tt(LPAR()#q+RPAR()). This does
not apply to the right hand side of pattern match operators as the
@ -2694,14 +2695,15 @@ whole list matches if at least one of the sublists matches (they are
however, affect all matches generated, independent of the sublist in
which they are given. These are the qualifiers `tt(M)', `tt(T)',
`tt(N)', `tt(D)', `tt(n)', `tt(o)', `tt(O)' and the subscripts given
in brackets (`tt([...])').
in brackets (`tt([)var(...)tt(])').
If a `tt(:)' appears in a qualifier list, the remainder of the expression in
parenthesis is interpreted as a modifier (see noderef(Modifiers)
in noderef(History Expansion)). Each modifier must be introduced by a
separate `tt(:)'. Note also that the result after modification does not
have to be an existing file. The name of any existing file can be followed
by a modifier of the form `tt((:..))' even if no actual filename generation
by a modifier of the form `tt(LPAR():)var(...)tt(RPAR())'
even if no actual filename generation
is performed, although note that the presence of the parentheses
causes the entire expression to be subjected to any global pattern matching
options such as tt(NULL_GLOB). Thus:

View file

@ -191,7 +191,7 @@ use the positional parameters instead of the var(word)s.
More than one parameter var(name) can appear before the list of
var(word)s. If var(N) var(name)s are given, then on each execution of the
loop the next tt(N) var(word)s are assigned to the corresponding
loop the next var(N) var(word)s are assigned to the corresponding
parameters. If there are more var(name)s than remaining var(word)s, the
remaining parameters are each set to the empty string. Execution of the
loop ends when there is no remaining var(word) to assign to the first
@ -353,7 +353,7 @@ The body of the function is the var(list) between
the tt({) and tt(}). See noderef(Functions).
If the option tt(SH_GLOB) is set for compatibility with other shells, then
whitespace may appear between between the left and right parentheses when
whitespace may appear between the left and right parentheses when
there is a single var(word); otherwise, the parentheses will be treated as
forming a globbing pattern in that case.
@ -396,8 +396,9 @@ code is a concern.
The short versions below only work if var(sublist) is of the form `tt({)
var(list) tt(})' or if the tt(SHORT_LOOPS) option is set. For the tt(if),
tt(while) and tt(until) commands, in both these cases the test part of the
loop must also be suitably delimited, such as by `tt([[ ... ]])' or `tt(((
... )))', else the end of the test will not be recognized. For the
loop must also be suitably delimited, such as by `tt([[) var(...) tt(]])' or
`tt(LPAR()LPAR()) var(...) tt(RPAR()RPAR())',
else the end of the test will not be recognized. For the
tt(for), tt(repeat), tt(case) and tt(select) commands no such special form
for the arguments is necessary, but the other condition (the special form
of var(sublist) or use of the tt(SHORT_LOOPS) option) still applies.
@ -420,7 +421,7 @@ example(if true { # Does not work!
does em(not), since the test is not suitably delimited.
)
item(tt(if) var(list) var(sublist))(
A short form of the alternate `if'. The same limitations on the form of
A short form of the alternate tt(if). The same limitations on the form of
var(list) apply as for the previous form.
)
item(tt(for) var(name) ... tt(LPAR()) var(word) ... tt(RPAR()) var(sublist))(
@ -451,7 +452,7 @@ This is a short form of tt(repeat).
item(tt(case) var(word) tt({) [ [tt(LPAR())] var(pattern) [ tt(|) var(pattern) ] ... tt(RPAR()) var(list) (tt(;;)|tt(;&)|tt(;|)) ] ... tt(}))(
An alternative form of tt(case).
)
item(tt(select) var(name) [ tt(in) var(word) var(term) ] var(sublist))(
item(tt(select) var(name) [ tt(in) var(word) ... var(term) ] var(sublist))(
where var(term) is at least one newline or tt(;).
A short form of tt(select).
)
@ -617,7 +618,7 @@ code fragment might be re-executed.
texinode(Quoting)()(Aliasing)(Shell Grammar)
sect(Quoting)
cindex(quoting)
A character may be var(quoted) (that is, made
A character may be em(quoted) (that is, made
to stand for itself) by preceding it with a `tt(\)'.
`tt(\)' followed by a newline is ignored.

View file

@ -792,7 +792,7 @@ Save each command's beginning timestamp (in seconds since the epoch)
and the duration (in seconds) to the history file. The format of
this prefixed data is:
`tt(:) var(<beginning time>)tt(:)var(<elapsed seconds>)tt(;)var(<command>)'.
`tt(: )var(<beginning time>)tt(:)var(<elapsed seconds>)tt(;)var(<command>)'.
)
pindex(HIST_ALLOW_CLOBBER)
pindex(NO_HIST_ALLOW_CLOBBER)
@ -932,7 +932,7 @@ pindex(HISTSAVEBYCOPY)
pindex(NOHISTSAVEBYCOPY)
item(tt(HIST_SAVE_BY_COPY) <D>)(
When the history file is re-written, we normally write out a copy of
the file named $HISTFILE.new and then rename it over the old one.
the file named tt($HISTFILE.new) and then rename it over the old one.
However, if this option is unset, we instead truncate the old
history file and write out the new version in-place. If one of the
history-appending options is enabled, this option only has an effect
@ -974,7 +974,7 @@ are added to the tt($HISTFILE) incrementally (as soon as they are
entered), rather than waiting until the shell exits.
The file will still be periodically re-written to trim it when the
number of lines grows 20% beyond the value specified by
tt($SAVEHIST) (see also the HIST_SAVE_BY_COPY option).
tt($SAVEHIST) (see also the tt(HIST_SAVE_BY_COPY) option).
)
pindex(INC_APPEND_HISTORY_TIME)
pindex(NO_INC_APPEND_HISTORY_TIME)
@ -1483,8 +1483,8 @@ wrap to the next line when a partial line is present (note that this is
only successful if your terminal has automatic margins, which is typical).
When a partial line is preserved, by default you will see an inverse+bold
character at the end of the partial line: a "%" for a normal user or
a "#" for root. If set, the shell parameter tt(PROMPT_EOL_MARK) can be
character at the end of the partial line: a `tt(%)' for a normal user or
a `tt(#)' for root. If set, the shell parameter tt(PROMPT_EOL_MARK) can be
used to customize how the end of partial lines are shown.
NOTE: if the tt(PROMPT_CR) option is not set, enabling this option will
@ -1548,7 +1548,7 @@ cindex(operator precedence)
item(tt(C_PRECEDENCES))(
This alters the precedence of arithmetic operators to be more
like C and other programming languages;
ifnzman(Arithmetic Evaluation)\
ifnzman(noderef(Arithmetic Evaluation))\
ifzman(the section ARITHMETIC EVALUATION in zmanref(zshmisc))
has an explicit list.
)
@ -1856,8 +1856,8 @@ pindex(NOCSHJUNKIELOOPS)
cindex(csh, loop style)
cindex(loop style, csh)
item(tt(CSH_JUNKIE_LOOPS) <C>)(
Allow loop bodies to take the form `var(list); tt(end)' instead of
`tt(do) var(list); tt(done)'.
Allow loop bodies to take the form `var(list)tt(; end)' instead of
`tt(do )var(list)tt(; done)'.
)
pindex(CSH_JUNKIE_QUOTES)
pindex(NO_CSH_JUNKIE_QUOTES)
@ -2113,7 +2113,7 @@ pindex(NOSHFILEEXPANSION)
cindex(sh, expansion style)
cindex(expansion style, sh)
item(tt(SH_FILE_EXPANSION) <K> <S>)(
Perform filename expansion (e.g., ~ expansion) em(before)
Perform filename expansion (e.g., tt(~) expansion) em(before)
parameter expansion, command substitution, arithmetic expansion
and brace expansion.
If this option is unset, it is performed em(after)

View file

@ -111,7 +111,7 @@ indent(tt(typeset -A) var(name))
When var(name) refers to an associative array, the list in an assignment
is interpreted as alternating keys and values:
ifzman()
indent(set -A var(name) var(key) var(value) ...)
indent(tt(set -A) var(name) var(key) var(value) ...)
indent(var(name)tt(=LPAR())var(key) var(value) ...tt(RPAR()))
Every var(key) must have a var(value) in this case. Note that this
@ -282,14 +282,14 @@ pattern and the result is the first matching array element, substring or
word (if the parameter is an array, if it is a scalar, or if it is a
scalar and the `tt(w)' flag is given, respectively). The subscript used
is the number of the matching element, so that pairs of subscripts such as
`tt($foo[(r))var(??)tt(,3])' and `tt($foo[(r))var(??)tt(,(r)f*])' are
`tt($foo[(r)??,3])' and `tt($foo[(r)??,(r)f*])' are
possible if the parameter is not an associative array. If the
parameter is an associative array, only the value part of each pair is
compared to the pattern, and the result is that value.
If a search through an ordinary array failed, the search sets the
subscript to one past the end of the array, and hence
tt(${array[(r)pattern]}) will substitute the empty string. Thus the
tt(${array[(r))var(pattern)tt(]}) will substitute the empty string. Thus the
success of a search can be tested by using the tt((i)) flag, for
example (assuming the option tt(KSH_ARRAYS) is not in effect):
@ -1075,8 +1075,8 @@ example, if the value is `tt(fc *)' then commands that invoke the
interactive history editor are never written to the history file.
Note that tt(HISTORY_IGNORE) defines a single pattern: to
specify alternatives use the `tt(+LPAR()first|second|...+RPAR())'
syntax.
specify alternatives use the
`tt(LPAR())var(first)tt(|)var(second)tt(|)var(...)tt(RPAR())' syntax.
Compare the tt(HIST_NO_STORE) option or the tt(zshaddhistory) hook,
either of which would prevent such commands from being added to the
@ -1450,7 +1450,7 @@ sitem(tt(%W))(Number of times the process was swapped.)
sitem(tt(%X))(The average amount in (shared) text space used in kilobytes.)
sitem(tt(%D))(The average amount in (unshared) data/stack space used in
kilobytes.)
sitem(tt(%K))(The total space used (%X+%D) in kilobytes.)
sitem(tt(%K))(The total space used (tt(%X)PLUS()tt(%D)) in kilobytes.)
sitem(tt(%M))(The maximum memory the process had in use at any time in
megabytes.)
sitem(tt(%F))(The number of major page faults (page needed to be brought

View file

@ -155,7 +155,7 @@ ifnzman(noderef(Simple Commands & Pipelines))
is a shorthand for `tt(2>&1 |)'.
The various forms of process substitution, `tt(<LPAR())var(list)tt(RPAR())',
and `tt(=LPAR())var(list)(RPAR())' for input and
and `tt(=LPAR())var(list)tt(RPAR())' for input and
`tt(>LPAR())var(list)tt(RPAR())' for output, are often used together with
redirection. For example, if var(word) in an output redirection is of the
form `tt(>LPAR())var(list)tt(RPAR())' then the output is piped to the
@ -176,7 +176,7 @@ is guaranteed to be at least 10 and set the parameter named by the
identifier to the file descriptor opened. No whitespace is allowed
between the closing brace and the redirection character. For example:
indent(... {myfd}>&1)
indent(... tt({myfd}>&1))
This opens a new file descriptor that is a duplicate of file descriptor
1 and sets the parameter tt(myfd) to the number of the file descriptor,
@ -275,9 +275,10 @@ If the tt(MULTIOS) option is em(un)set,
each redirection replaces the previous redirection for that file descriptor.
However, all files redirected to are actually opened, so
example(echo foo > bar > baz)
example(echo Hello > bar > baz)
when tt(MULTIOS) is unset will truncate bar, and write `tt(foo)' into baz.
when tt(MULTIOS) is unset will truncate `tt(bar)', and write `tt(Hello)'
into `tt(baz)'.
There is a problem when an output multio is attached to an external
program. A simple example shows this:

File diff suppressed because it is too large Load diff