summaryrefslogtreecommitdiff
path: root/Doc/help
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/help')
-rw-r--r--Doc/help/alias8
-rw-r--r--Doc/help/fc95
-rw-r--r--Doc/help/fg2
-rw-r--r--Doc/help/functions120
-rw-r--r--Doc/help/getopts15
-rw-r--r--Doc/help/hash46
-rw-r--r--Doc/help/jobs33
-rw-r--r--Doc/help/kill26
-rw-r--r--Doc/help/let6
-rw-r--r--Doc/help/limit24
-rw-r--r--Doc/help/log2
-rw-r--r--Doc/help/read2
-rw-r--r--Doc/help/return13
-rw-r--r--Doc/help/ttyctl3
-rw-r--r--Doc/help/typeset29
-rw-r--r--Doc/help/umask12
16 files changed, 254 insertions, 182 deletions
diff --git a/Doc/help/alias b/Doc/help/alias
index 7fe9e3166..a746af240 100644
--- a/Doc/help/alias
+++ b/Doc/help/alias
@@ -3,7 +3,13 @@ alias [ {+|-}gmrsL ] [ name[=value] ... ]
that value. A trailing space in value causes the next word to
be checked for alias expansion. If the -g flag is present, de-
fine a global alias; global aliases are expanded even if they do
- not occur in command position.
+ not occur in command position:
+
+ % perldoc --help 2>&1 | grep 'built-in functions'
+ -f Search Perl built-in functions
+ % alias -g HG='--help 2>&1 | grep'
+ % perldoc HG 'built-in functions'
+ -f Search Perl built-in functions
If the -s flag is present, define a suffix alias: if the command
word on a command line is in the form `text.name', where text is
diff --git a/Doc/help/fc b/Doc/help/fc
index 07fa8ae01..5a4b149e2 100644
--- a/Doc/help/fc
+++ b/Doc/help/fc
@@ -1,4 +1,5 @@
-fc [ -e ename ] [ -LI ] [ -m match ] [ old=new ... ] [ first [ last ] ]
+fc [ -e ename ] [ -s ] [ -LI ] [ -m match ] [ old=new ... ] [ first [
+last ] ]
fc -l [ -LI ] [ -nrdfEiD ] [ -t timefmt ] [ -m match ]
[ old=new ... ] [ first [ last ] ]
fc -p [ -a ] [ filename [ histsize [ savehistsize ] ] ]
@@ -6,26 +7,27 @@ fc -P
fc -ARWI [ filename ]
The fc command controls the interactive history mechanism. Note
that reading and writing of history options is only performed if
- the shell is interactive. Usually this is detected automati-
- cally, but it can be forced by setting the interactive option
+ the shell is interactive. Usually this is detected automati-
+ cally, but it can be forced by setting the interactive option
when starting the shell.
- The first two forms of this command select a range of events
- from first to last from the history list. The arguments first
- and last may be specified as a number or as a string. A nega-
- tive number is used as an offset to the current history event
+ The first two forms of this command select a range of events
+ from first to last from the history list. The arguments first
+ and last may be specified as a number or as a string. A nega-
+ tive number is used as an offset to the current history event
number. A string specifies the most recent event beginning with
- the given string. All substitutions old=new, if any, are then
+ the given string. All substitutions old=new, if any, are then
performed on the text of the events.
- In addition to the number range,
+ The range of events selected by numbers can be narrowed further
+ by the following flags.
-I restricts to only internal events (not from $HISTFILE)
-L restricts to only local events (not from other shells,
see SHARE_HISTORY in zshoptions(1) -- note that $HISTFILE
is considered local when read at startup)
- -m takes the first argument as a pattern (should be quoted)
- and only the history events matching this pattern are
- considered
+ -m takes the first argument as a pattern (which should be
+ quoted) and only the history events matching this pattern
+ are considered
If first is not specified, it will be set to -1 (the most recent
event), or to -16 if the -l flag is given. If last is not spec-
@@ -43,65 +45,66 @@ fc -ARWI [ filename ]
ename is `-', no editor is invoked. When editing is complete,
the edited command is executed.
- The flag -r reverses the order of the events and the flag -n
- suppresses event numbers when listing.
+ The flag `-s' is equivalent to `-e -'. The flag -r reverses the
+ order of the events and the flag -n suppresses event numbers
+ when listing.
Also when listing,
-d prints timestamps for each event
- -f prints full time-date stamps in the US `MM/DD/YY hh:mm'
+ -f prints full time-date stamps in the US `MM/DD/YY hh:mm'
format
- -E prints full time-date stamps in the European `dd.mm.yyyy
+ -E prints full time-date stamps in the European `dd.mm.yyyy
hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd
hh:mm' format
- -t fmt prints time and date stamps in the given format; fmt is
- formatted with the strftime function with the zsh exten-
- sions described for the %D{string} prompt format in the
+ -t fmt prints time and date stamps in the given format; fmt is
+ formatted with the strftime function with the zsh exten-
+ sions described for the %D{string} prompt format in the
section EXPANSION OF PROMPT SEQUENCES in zshmisc(1). The
resulting formatted string must be no more than 256 char-
acters or will not be printed
-D prints elapsed times; may be combined with one of the op-
tions above
- `fc -p' pushes the current history list onto a stack and
+ `fc -p' pushes the current history list onto a stack and
switches to a new history list. If the -a option is also speci-
- fied, this history list will be automatically popped when the
- current function scope is exited, which is a much better solu-
+ fied, this history list will be automatically popped when the
+ current function scope is exited, which is a much better solu-
tion than creating a trap function to call `fc -P' manually. If
- no arguments are specified, the history list is left empty,
- $HISTFILE is unset, and $HISTSIZE & $SAVEHIST are set to their
- default values. If one argument is given, $HISTFILE is set to
+ no arguments are specified, the history list is left empty,
+ $HISTFILE is unset, and $HISTSIZE & $SAVEHIST are set to their
+ default values. If one argument is given, $HISTFILE is set to
that filename, $HISTSIZE & $SAVEHIST are left unchanged, and the
- history file is read in (if it exists) to initialize the new
- list. If a second argument is specified, $HISTSIZE & $SAVEHIST
+ history file is read in (if it exists) to initialize the new
+ list. If a second argument is specified, $HISTSIZE & $SAVEHIST
are instead set to the single specified numeric value. Finally,
if a third argument is specified, $SAVEHIST is set to a separate
- value from $HISTSIZE. You are free to change these environment
- values for the new history list however you desire in order to
+ value from $HISTSIZE. You are free to change these environment
+ values for the new history list however you desire in order to
manipulate the new history list.
`fc -P' pops the history list back to an older list saved by `fc
- -p'. The current list is saved to its $HISTFILE before it is
- destroyed (assuming that $HISTFILE and $SAVEHIST are set appro-
- priately, of course). The values of $HISTFILE, $HISTSIZE, and
- $SAVEHIST are restored to the values they had when `fc -p' was
- called. Note that this restoration can conflict with making
+ -p'. The current list is saved to its $HISTFILE before it is
+ destroyed (assuming that $HISTFILE and $SAVEHIST are set appro-
+ priately, of course). The values of $HISTFILE, $HISTSIZE, and
+ $SAVEHIST are restored to the values they had when `fc -p' was
+ called. Note that this restoration can conflict with making
these variables "local", so your best bet is to avoid local dec-
- larations for these variables in functions that use `fc -p'.
- The one other guaranteed-safe combination is declaring these
- variables to be local at the top of your function and using the
- automatic option (-a) with `fc -p'. Finally, note that it is
+ larations for these variables in functions that use `fc -p'.
+ The one other guaranteed-safe combination is declaring these
+ variables to be local at the top of your function and using the
+ automatic option (-a) with `fc -p'. Finally, note that it is
legal to manually pop a push marked for automatic popping if you
need to do so before the function exits.
- `fc -R' reads the history from the given file, `fc -W' writes
- the history out to the given file, and `fc -A' appends the his-
- tory out to the given file. If no filename is specified, the
- $HISTFILE is assumed. If the -I option is added to -R, only
- those events that are not already contained within the internal
- history list are added. If the -I option is added to -A or -W,
- only those events that are new since last incremental ap-
- pend/write to the history file are appended/written. In any
+ `fc -R' reads the history from the given file, `fc -W' writes
+ the history out to the given file, and `fc -A' appends the his-
+ tory out to the given file. If no filename is specified, the
+ $HISTFILE is assumed. If the -I option is added to -R, only
+ those events that are not already contained within the internal
+ history list are added. If the -I option is added to -A or -W,
+ only those events that are new since last incremental ap-
+ pend/write to the history file are appended/written. In any
case, the created file will have no more than $SAVEHIST entries.
history
diff --git a/Doc/help/fg b/Doc/help/fg
index f52ca1fd5..da8897332 100644
--- a/Doc/help/fg
+++ b/Doc/help/fg
@@ -1,4 +1,4 @@
fg [ job ... ]
job ...
- Bring each specified job in turn to the foreground. If no job
+ Bring each specified job in turn to the foreground. If no job
is specified, resume the current job.
diff --git a/Doc/help/functions b/Doc/help/functions
index 2f1a5dd0b..cadbd0350 100644
--- a/Doc/help/functions
+++ b/Doc/help/functions
@@ -3,50 +3,92 @@ functions -c oldfn newfn
functions -M [-s] mathfn [ min [ max [ shellfn ] ] ]
functions -M [ -m pattern ... ]
functions +M [ -m ] mathfn ...
- Equivalent to typeset -f, with the exception of the -c, -x, -M
- and -W options. For functions -u and functions -U, see au-
+ Equivalent to typeset -f, with the exception of the -c, -x, -M
+ and -W options. For functions -u and functions -U, see au-
toload, which provides additional options.
The -x option indicates that any functions output will have each
- leading tab for indentation, added by the shell to show syntac-
- tic structure, expanded to the given number num of spaces. num
+ leading tab for indentation, added by the shell to show syntac-
+ tic structure, expanded to the given number num of spaces. num
can also be 0 to suppress all indentation.
- The -W option turns on the option WARN_NESTED_VAR for the named
- function or functions only. The option is turned off at the
- start of nested functions (apart from anonoymous functions) un-
+ The -W option turns on the option WARN_NESTED_VAR for the named
+ function or functions only. The option is turned off at the
+ start of nested functions (apart from anonoymous functions) un-
less the called function also has the -W attribute.
- The -c option causes oldfn to be copied to newfn. The copy is
- efficiently handled internally by reference counting. If oldfn
+ The -c option causes oldfn to be copied to newfn. The copy is
+ efficiently handled internally by reference counting. If oldfn
was marked for autoload it is first loaded and if this fails the
copy fails. Either function may subsequently be redefined with-
- out affecting the other. A typical idiom is that oldfn is the
+ out affecting the other. A typical idiom is that oldfn is the
name of a library shell function which is then redefined to call
newfn, thereby installing a modified version of the function.
+ The -M and +M flags
+
Use of the -M option may not be combined with any of the options
handled by typeset -f.
functions -M mathfn defines mathfn as the name of a mathematical
- function recognised in all forms of arithmetical expressions;
- see the section `Arithmetic Evaluation' in zshmisc(1). By de-
- fault mathfn may take any number of comma-separated arguments.
- If min is given, it must have exactly min args; if min and max
- are both given, it must have at least min and at most max args.
+ function recognised in all forms of arithmetical expressions;
+ see the section `Arithmetic Evaluation' in zshmisc(1). By de-
+ fault mathfn may take any number of comma-separated arguments.
+ If min is given, it must have exactly min args; if min and max
+ are both given, it must have at least min and at most max args.
max may be -1 to indicate that there is no upper limit.
- By default the function is implemented by a shell function of
- the same name; if shellfn is specified it gives the name of the
- corresponding shell function while mathfn remains the name used
- in arithmetical expressions. The name of the function in $0 is
- mathfn (not shellfn as would usually be the case), provided the
+ By default the function is implemented by a shell function of
+ the same name; if shellfn is specified it gives the name of the
+ corresponding shell function while mathfn remains the name used
+ in arithmetical expressions. The name of the function in $0 is
+ mathfn (not shellfn as would usually be the case), provided the
option FUNCTION_ARGZERO is in effect. The positional parameters
- in the shell function correspond to the arguments of the mathe-
- matical function call. The result of the last arithmetical ex-
- pression evaluated inside the shell function (even if it is a
- form that normally only returns a status) gives the result of
- the mathematical function.
+ in the shell function correspond to the arguments of the mathe-
+ matical function call.
+
+ The result of the last arithmetical expression evaluated inside
+ the shell function gives the result of the mathematical func-
+ tion. This is not limited to arithmetic substitutions of the
+ form $((...)), but also includes arithmetical expressions evalu-
+ ated in any other way, including by the let builtin, by ((...))
+ statements, and even by the return builtin and by array sub-
+ scripts. Therefore, care must be taken not to use syntactical
+ constructs that perform arithmetic evaluation after evaluating
+ what is to be the result of the function. For example:
+
+ # WRONG
+ zmath_cube() {
+ (( $1 * $1 * $1 ))
+ return 0
+ }
+ functions -M cube 1 1 zmath_cube
+ print $(( cube(3) ))
+
+ This will print `0' because of the return.
+
+ Commenting the return out would lead to a different problem: the
+ ((...)) statement would become the last statement in the func-
+ tion, so the return status ($?) of the function would be
+ non-zero (indicating failure) whenever the arithmetic result of
+ the function would happen to be zero (numerically):
+
+ # WRONG
+ zmath_cube() {
+ (( $1 * $1 * $1 ))
+ }
+ functions -M cube 1 1 zmath_cube
+ print $(( cube(0) ))
+
+ Instead, the true builtin can be used:
+
+ # RIGHT
+ zmath_cube() {
+ (( $1 * $1 * $1 ))
+ true
+ }
+ functions -M cube 1 1 zmath_cube
+ print $(( cube(3) ))
If the additional option -s is given to functions -M, the argu-
ment to the function is a single string: anything between the
@@ -54,28 +96,20 @@ functions +M [ -m ] mathfn ...
tion as a single argument, even if it includes commas or white
space. The minimum and maximum argument specifiers must there-
fore be 1 if given. An empty argument list is passed as a
- zero-length string.
+ zero-length string. Thus, the following string function takes a
+ single argument, including the commas, and prints 11:
+
+ stringfn() { (( $#1 )); true }
+ functions -Ms stringfn
+ print $(( stringfn(foo,bar,rod) ))
functions -M with no arguments lists all such user-defined func-
tions in the same form as a definition. With the additional op-
- tion -m and a list of arguments, all functions whose mathfn
+ tion -m and a list of arguments, all functions whose mathfn
matches one of the pattern arguments are listed.
function +M removes the list of mathematical functions; with the
- additional option -m the arguments are treated as patterns and
- all functions whose mathfn matches the pattern are removed.
- Note that the shell function implementing the behaviour is not
+ additional option -m the arguments are treated as patterns and
+ all functions whose mathfn matches the pattern are removed.
+ Note that the shell function implementing the behaviour is not
removed (regardless of whether its name coincides with mathfn).
-
- For example, the following prints the cube of 3:
-
- zmath_cube() { (( $1 * $1 * $1 )) }
- functions -M cube 1 1 zmath_cube
- print $(( cube(3) ))
-
- The following string function takes a single argument, including
- the commas, so prints 11:
-
- stringfn() { (( $#1 )) }
- functions -Ms stringfn
- print $(( stringfn(foo,bar,rod) ))
diff --git a/Doc/help/getopts b/Doc/help/getopts
index ef73c55c1..bb89d2f2a 100644
--- a/Doc/help/getopts
+++ b/Doc/help/getopts
@@ -16,15 +16,16 @@ getopts optstring name [ arg ... ]
The first option to be examined may be changed by explicitly as-
signing to OPTIND. OPTIND has an initial value of 1, and is
normally set to 1 upon entry to a shell function and restored
- upon exit (this is disabled by the POSIX_BUILTINS option). OP-
- TARG is not reset and retains its value from the most recent
- call to getopts. If either of OPTIND or OPTARG is explicitly
+ upon exit. (The POSIX_BUILTINS option disables this, and also
+ changes the way the value is calculated to match other shells.)
+ OPTARG is not reset and retains its value from the most recent
+ call to getopts. If either of OPTIND or OPTARG is explicitly
unset, it remains unset, and the index or option argument is not
stored. The option itself is still stored in name in this case.
A leading `:' in optstring causes getopts to store the letter of
- any invalid option in OPTARG, and to set name to `?' for an un-
- known option and to `:' when a required argument is missing.
- Otherwise, getopts sets name to `?' and prints an error message
- when an option is invalid. The exit status is nonzero when
+ any invalid option in OPTARG, and to set name to `?' for an un-
+ known option and to `:' when a required argument is missing.
+ Otherwise, getopts sets name to `?' and prints an error message
+ when an option is invalid. The exit status is nonzero when
there are no more options.
diff --git a/Doc/help/hash b/Doc/help/hash
index c1dfb49f2..dcbc7fd1c 100644
--- a/Doc/help/hash
+++ b/Doc/help/hash
@@ -1,47 +1,47 @@
hash [ -Ldfmrv ] [ name[=value] ] ...
- hash can be used to directly modify the contents of the command
- hash table, and the named directory hash table. Normally one
- would modify these tables by modifying one's PATH (for the com-
- mand hash table) or by creating appropriate shell parameters
- (for the named directory hash table). The choice of hash table
- to work on is determined by the -d option; without the option
- the command hash table is used, and with the option the named
+ hash can be used to directly modify the contents of the command
+ hash table, and the named directory hash table. Normally one
+ would modify these tables by modifying one's PATH (for the com-
+ mand hash table) or by creating appropriate shell parameters
+ (for the named directory hash table). The choice of hash table
+ to work on is determined by the -d option; without the option
+ the command hash table is used, and with the option the named
directory hash table is used.
A command name starting with a / is never hashed, whether by ex-
- plicit use of the hash command or otherwise. Such a command is
+ plicit use of the hash command or otherwise. Such a command is
always found by direct look up in the file system.
- Given no arguments, and neither the -r or -f options, the se-
+ Given no arguments, and neither the -r or -f options, the se-
lected hash table will be listed in full.
- The -r option causes the selected hash table to be emptied. It
- will be subsequently rebuilt in the normal fashion. The -f op-
- tion causes the selected hash table to be fully rebuilt immedi-
- ately. For the command hash table this hashes all the absolute
- directories in the PATH, and for the named directory hash table
+ The -r option causes the selected hash table to be emptied. It
+ will be subsequently rebuilt in the normal fashion. The -f op-
+ tion causes the selected hash table to be fully rebuilt immedi-
+ ately. For the command hash table this hashes all the absolute
+ directories in the PATH, and for the named directory hash table
this adds all users' home directories. These two options cannot
be used with any arguments.
- The -m option causes the arguments to be taken as patterns
- (which should be quoted) and the elements of the hash table
- matching those patterns are printed. This is the only way to
+ The -m option causes the arguments to be taken as patterns
+ (which should be quoted) and the elements of the hash table
+ matching those patterns are printed. This is the only way to
display a limited selection of hash table elements.
- For each name with a corresponding value, put `name' in the se-
+ For each name with a corresponding value, put `name' in the se-
lected hash table, associating it with the pathname `value'. In
- the command hash table, this means that whenever `name' is used
- as a command argument, the shell will try to execute the file
+ the command hash table, this means that whenever `name' is used
+ as a command argument, the shell will try to execute the file
given by `value'. In the named directory hash table, this means
that `value' may be referred to as `~name'.
- For each name with no corresponding value, attempt to add name
+ For each name with no corresponding value, attempt to add name
to the hash table, checking what the appropriate value is in the
- normal manner for that hash table. If an appropriate value
+ normal manner for that hash table. If an appropriate value
can't be found, then the hash table will be unchanged.
The -v option causes hash table entries to be listed as they are
- added by explicit specification. If has no effect if used with
+ added by explicit specification. If has no effect if used with
-f.
If the -L flag is present, then each hash table entry is printed
diff --git a/Doc/help/jobs b/Doc/help/jobs
index 7a602da2b..56f4e34fd 100644
--- a/Doc/help/jobs
+++ b/Doc/help/jobs
@@ -1,14 +1,33 @@
jobs [ -dlprs ] [ job ... ]
jobs -Z string
- Lists information about each given job, or all jobs if job is
- omitted. The -l flag lists process IDs, and the -p flag lists
- process groups. If the -r flag is specified only running jobs
+ Lists information about each given job, or all jobs if job is
+ omitted. The -l flag lists process IDs, and the -p flag lists
+ process groups. If the -r flag is specified only running jobs
will be listed and if the -s flag is given only stopped jobs are
- shown. If the -d flag is given, the directory from which the
- job was started (which may not be the current directory of the
+ shown. If the -d flag is given, the directory from which the
+ job was started (which may not be the current directory of the
job) will also be shown.
- The -Z option replaces the shell's argument and environment
- space with the given string, truncated if necessary to fit.
+ The -Z option replaces the shell's argument and environment
+ space with the given string, truncated if necessary to fit.
This will normally be visible in ps (ps(1)) listings. This fea-
ture is typically used by daemons, to indicate their state.
+
+ Full job control is only available in the top-level interactive
+ shell, not in commands run in the left hand side of pipelines or
+ within the (...) construct. However, a snapshot of the job
+ state at that point is taken, so it is still possible to use the
+ jobs builtin, or any parameter providing job information. This
+ gives information about the state of jobs at the point the sub-
+ shell was created. If background processes are created within
+ the subshell, then instead information about those processes is
+ provided.
+
+ For example,
+
+ sleep 10 & # Job in background
+ ( # Shell forks
+ jobs # Shows information about "sleep 10 &"
+ sleep 5 & # Process in background (no job control)
+ jobs # Shows information about "sleep 5 &"
+ )
diff --git a/Doc/help/kill b/Doc/help/kill
index c68d46704..9112ffefe 100644
--- a/Doc/help/kill
+++ b/Doc/help/kill
@@ -1,24 +1,24 @@
kill [ -s signal_name | -n signal_number | -sig ] job ...
kill -l [ sig ... ]
- Sends either SIGTERM or the specified signal to the given jobs
- or processes. Signals are given by number or by names, with or
- without the `SIG' prefix. If the signal being sent is not
- `KILL' or `CONT', then the job will be sent a `CONT' signal if
- it is stopped. The argument job can be the process ID of a job
+ Sends either SIGTERM or the specified signal to the given jobs
+ or processes. Signals are given by number or by names, with or
+ without the `SIG' prefix. If the signal being sent is not
+ `KILL' or `CONT', then the job will be sent a `CONT' signal if
+ it is stopped. The argument job can be the process ID of a job
not in the job list. In the second form, kill -l, if sig is not
- specified the signal names are listed. Otherwise, for each sig
- that is a name, the corresponding signal number is listed. For
- each sig that is a signal number or a number representing the
- exit status of a process which was terminated or stopped by a
+ specified the signal names are listed. Otherwise, for each sig
+ that is a name, the corresponding signal number is listed. For
+ each sig that is a signal number or a number representing the
+ exit status of a process which was terminated or stopped by a
signal the name of the signal is printed.
- On some systems, alternative signal names are allowed for a few
+ On some systems, alternative signal names are allowed for a few
signals. Typical examples are SIGCHLD and SIGCLD or SIGPOLL and
SIGIO, assuming they correspond to the same signal number. kill
- -l will only list the preferred form, however kill -l alt will
- show if the alternative form corresponds to a signal number.
+ -l will only list the preferred form, however kill -l alt will
+ show if the alternative form corresponds to a signal number.
For example, under Linux kill -l IO and kill -l POLL both output
29, hence kill -IO and kill -POLL have the same effect.
- Many systems will allow process IDs to be negative to kill a
+ Many systems will allow process IDs to be negative to kill a
process group or zero to kill the current process group.
diff --git a/Doc/help/let b/Doc/help/let
index 96f3dc167..2119df55c 100644
--- a/Doc/help/let
+++ b/Doc/help/let
@@ -1,6 +1,6 @@
let arg ...
- Evaluate each arg as an arithmetic expression. See the section
- `Arithmetic Evaluation' in zshmisc(1) for a description of
- arithmetic expressions. The exit status is 0 if the value of
+ Evaluate each arg as an arithmetic expression. See the section
+ `Arithmetic Evaluation' in zshmisc(1) for a description of
+ arithmetic expressions. The exit status is 0 if the value of
the last expression is nonzero, 1 if it is zero, and 2 if an er-
ror occurred.
diff --git a/Doc/help/limit b/Doc/help/limit
index 1e31b122d..342df33da 100644
--- a/Doc/help/limit
+++ b/Doc/help/limit
@@ -1,17 +1,17 @@
limit [ -hs ] [ resource [ limit ] ] ...
- Set or display resource limits. Unless the -s flag is given,
- the limit applies only the children of the shell. If -s is
- given without other arguments, the resource limits of the cur-
- rent shell is set to the previously set resource limits of the
+ Set or display resource limits. Unless the -s flag is given,
+ the limit applies only the children of the shell. If -s is
+ given without other arguments, the resource limits of the cur-
+ rent shell is set to the previously set resource limits of the
children.
If limit is not specified, print the current limit placed on re-
- source, otherwise set the limit to the specified value. If the
+ source, otherwise set the limit to the specified value. If the
-h flag is given, use hard limits instead of soft limits. If no
resource is given, print all limits.
When looping over multiple resources, the shell will abort imme-
- diately if it detects a badly formed argument. However, if it
+ diately if it detects a badly formed argument. However, if it
fails to set a limit for some other reason it will continue try-
ing to set the remaining limits.
@@ -20,7 +20,7 @@ limit [ -hs ] [ resource [ limit ] ] ...
addressspace
Maximum amount of address space used.
aiomemorylocked
- Maximum amount of memory locked in RAM for AIO opera-
+ Maximum amount of memory locked in RAM for AIO opera-
tions.
aiooperations
Maximum number of AIO operations.
@@ -71,10 +71,10 @@ limit [ -hs ] [ resource [ limit ] ] ...
for the resource by the operating system.
If argument corresponds to a number which is out of the range of
- the resources configured into the shell, the shell will try to
+ the resources configured into the shell, the shell will try to
read or write the limit anyway, and will report an error if this
- fails. As the shell does not store such resources internally,
- an attempt to set the limit will fail unless the -s option is
+ fails. As the shell does not store such resources internally,
+ an attempt to set the limit will fail unless the -s option is
present.
limit is a number, with an optional scaling factor, as follows:
@@ -86,6 +86,6 @@ limit [ -hs ] [ resource [ limit ] ] ...
[mm:]ss
minutes and seconds
- The limit command is not made available by default when the
- shell starts in a mode emulating another shell. It can be made
+ The limit command is not made available by default when the
+ shell starts in a mode emulating another shell. It can be made
available with the command `zmodload -F zsh/rlimits b:limit'.
diff --git a/Doc/help/log b/Doc/help/log
deleted file mode 100644
index e6627fc5f..000000000
--- a/Doc/help/log
+++ /dev/null
@@ -1,2 +0,0 @@
-log List all users currently logged in who are affected by the cur-
- rent setting of the watch parameter.
diff --git a/Doc/help/read b/Doc/help/read
index 743389f72..ac14407ea 100644
--- a/Doc/help/read
+++ b/Doc/help/read
@@ -1,5 +1,5 @@
read [ -rszpqAclneE ] [ -t [ num ] ] [ -k [ num ] ] [ -d delim ]
- [ -u n ] [ name[?prompt] ] [ name ... ]
+ [ -u n ] [ [name][?prompt] ] [ name ... ]
Read one line and break it into fields using the characters in
$IFS as separators, except as noted below. The first field is
assigned to the first name, the second field to the second name,
diff --git a/Doc/help/return b/Doc/help/return
index d9a53e15b..61a32d48a 100644
--- a/Doc/help/return
+++ b/Doc/help/return
@@ -1,8 +1,13 @@
return [ n ]
Causes a shell function or `.' script to return to the invoking
script with the return status specified by an arithmetic expres-
- sion n. If n is omitted, the return status is that of the last
- command executed.
+ sion n. For example, the following prints `42':
+
+ () { integer foo=40; return "foo + 2" }
+ echo $?
+
+ If n is omitted, the return status is that of the last command
+ executed.
If return was executed from a trap in a TRAPNAL function, the
effect is different for zero and non-zero return status. With
@@ -12,5 +17,5 @@ return [ n ]
rupted except that the return status of the trap is retained.
Note that the numeric value of the signal which caused the trap
is passed as the first argument, so the statement `return
- $((128+$1))' will return the same status as if the signal had
- not been trapped.
+ "128+$1"' will return the same status as if the signal had not
+ been trapped.
diff --git a/Doc/help/ttyctl b/Doc/help/ttyctl
index 6736658f2..937fdf913 100644
--- a/Doc/help/ttyctl
+++ b/Doc/help/ttyctl
@@ -18,4 +18,5 @@ ttyctl [ -fu ]
command line are preserved. Strings of commands run between
editing the command line will see a consistent tty state. See
also the shell variable STTY for a means of initialising the tty
- before running external commands.
+ before running external commands and/or freezing the tty around
+ a single command.
diff --git a/Doc/help/typeset b/Doc/help/typeset
index 31f505fb7..852b39153 100644
--- a/Doc/help/typeset
+++ b/Doc/help/typeset
@@ -5,16 +5,21 @@ typeset -T [ {+|-}Uglrux ] [ {+|-}LRZp [ n ] ]
typeset -f [ {+|-}TUkmtuz ] [ + ] [ name ... ]
Set or display attributes and values for shell parameters.
- Except as noted below for control flags that change the behav-
- ior, a parameter is created for each name that does not already
- refer to one. When inside a function, a new parameter is cre-
- ated for every name (even those that already exist), and is un-
- set again when the function completes. See `Local Parameters'
- in zshparam(1). The same rules apply to special shell parame-
+ Except as noted below for control flags that change the behav-
+ ior, a parameter is created for each name that does not already
+ refer to one. When inside a function, a new parameter is cre-
+ ated for every name (even those that already exist), and is un-
+ set again when the function completes. See `Local Parameters'
+ in zshparam(1). The same rules apply to special shell parame-
ters, which retain their special attributes when made local.
- For each name=value assignment, the parameter name is set to
- value.
+ For each name=value assignment, the parameter name is set to
+ value. If the assignment is omitted and name does not refer to
+ an existing parameter, a new parameter is intialized to empty
+ string, zero, or empty array (as appropriate), unless the shell
+ option TYPESET_TO_UNSET is set. When that option is set, the
+ parameter attributes are recorded but the parameter remains un-
+ set.
If the shell option TYPESET_SILENT is not set, for each remain-
ing name that refers to a parameter that is already set, the
@@ -88,7 +93,7 @@ typeset -f [ {+|-}TUkmtuz ] [ + ] [ name ... ]
to typeset after expansion. Hence it is not possible to assign
to multiple arrays by this means.
- Note that each interface to any of the commands my be disabled
+ Note that each interface to any of the commands may be disabled
separately. For example, `disable -r typeset' disables the re-
served word interface to typeset, exposing the builtin inter-
face, while `disable typeset' disables the builtin. Note that
@@ -395,16 +400,16 @@ declare
Same as typeset.
float [ {+|-}Hghlprtux ] [ {+|-}EFLRZ [ n ] ] [ name[=value] ... ]
- Equivalent to typeset -E, except that options irrelevant to
+ Equivalent to typeset -E, except that options irrelevant to
floating point numbers are not permitted.
integer [ {+|-}Hghlprtux ] [ {+|-}LRZi [ n ] ] [ name[=value] ... ]
- Equivalent to typeset -i, except that options irrelevant to in-
+ Equivalent to typeset -i, except that options irrelevant to in-
tegers are not permitted.
local [ {+|-}AHUahlprtux ] [ {+|-}EFLRZi [ n ] ] [ name[=value] ... ]
Same as typeset, except that the options -g, and -f are not per-
- mitted. In this case the -x option does not force the use of
+ mitted. In this case the -x option does not force the use of
-g, i.e. exported variables will be local to functions.
readonly
diff --git a/Doc/help/umask b/Doc/help/umask
index ed29a4361..a27f722c8 100644
--- a/Doc/help/umask
+++ b/Doc/help/umask
@@ -1,8 +1,8 @@
umask [ -S ] [ mask ]
The umask is set to mask. mask can be either an octal number or
- a symbolic value as described in chmod(1). If mask is omitted,
- the current value is printed. The -S option causes the mask to
- be printed as a symbolic value. Otherwise, the mask is printed
- as an octal number. Note that in the symbolic form the permis-
- sions you specify are those which are to be allowed (not denied)
- to the users specified.
+ a symbolic value as described in the chmod(1) man page. If mask
+ is omitted, the current value is printed. The -S option causes
+ the mask to be printed as a symbolic value. Otherwise, the mask
+ is printed as an octal number. Note that in the symbolic form
+ the permissions you specify are those which are to be allowed
+ (not denied) to the users specified.