Manual Pages for UNIX Darwin command on man zshparam
MyWebUniversity

Manual Pages for UNIX Darwin command on man zshparam

ZSHPARAM(1) ZSHPARAM(1)

NAME

zshparam - zsh parameters

DESCRIPTION

A parameter has a name, a value, and a number of attributes. A name may be any sequence of alphanumeric characters and underscores, or the

single characters `**', `@@', `##', `??', `-', `$$', or `!!'. The value may

be a scalar (a string), an integer, an array (indexed numerically), or

an associative array (an unordered set of name-value pairs, indexed by

name). To declare the type of a parameter, or to assign a scalar or integer value to a parameter, use the ttyyppeesseett builtin. The value of a scalar or integer parameter may also be assigned by writing: name==value

If the integer attribute, -ii, is set for name, the value is subject to

arithmetic evaluation. Furthermore, by replacing `==' with `++==', a

parameter can be added or appended to. See the section `Array Parame-

ters' for additional forms of assignment.

To refer to the value of a parameter, write `$$name' or `$${{name}}'. See

Parameter Expansion in zshexpn(1) for complete details. In the parameter lists that follow, the mark `' indicates that the parameter is special. Special parameters cannot have their type

changed or their readonly attribute turned off, and if a special param-

eter is unset, then later recreated, the special properties will be retained. `' indicates that the parameter does not exist when the shell initializes in sshh or kksshh emulation mode. AARRRRAAYY PPAARRAAMMEETTEERRSS To assign an array value, write one of:

sseett -AA name value ...

name==((value ...)) If no parameter name exists, an ordinary array parameter is created. If the parameter name exists and is a scalar, it is replaced by a new array. Ordinary array parameters may also be explicitly declared with:

ttyyppeesseett -aa name

Associative arrays must be declared before assignment, by using:

ttyyppeesseett -AA name

When name refers to an associative array, the list in an assignment is interpreted as alternating keys and values:

set -A name key value ...

name==((key value ...)) Every key must have a value in this case. Note that this assigns to the entire array, deleting any elements that do not appear in the list. To create an empty array (including associative arrays), use one of:

sseett -AA name

name==(()) AArrrraayy SSuubbssccrriippttss Individual elements of an array may be selected using a subscript. A subscript of the form `[[exp]]' selects the single element exp, where exp

is an arithmetic expression which will be subject to arithmetic expan-

sion as if it were surrounded by `$$((((...))))'. The elements are numbered

beginning with 1, unless the KKSSHHAARRRRAAYYSS option is set in which case they are numbered from zero. Subscripts may be used inside braces used to delimit a parameter name,

thus `$${{ffoooo[[22]]}}' is equivalent to `$$ffoooo[[22]]'. If the KKSSHHAARRRRAAYYSS option

is set, the braced form is the only one that works, as bracketed expressions otherwise are not treated as subscripts. The same subscripting syntax is used for associative arrays, except that no arithmetic expansion is applied to exp. However, the parsing rules for arithmetic expressions still apply, which affects the way that certain special characters must be protected from interpretation. See Subscript Parsing below for details. A subscript of the form `[[**]]' or `[[@@]]' evaluates to all elements of an array; there is no difference between the two except when they appear

within double quotes. `""$$ffoooo[[**]]""' evaluates to `""$$ffoooo[[11]] $$ffoooo[[22]]

...""', whereas `""$$ffoooo[[@@]]""' evaluates to `""$$ffoooo[[11]]"" ""$$ffoooo[[22]]"" ...'. For

associative arrays, `[[**]]' or `[[@@]]' evaluate to all the values, in no particular order. Note that this does not substitute the keys; see the

documentation for the `kk' flag under Parameter Expansion Flags in zsh-

expn(1) for complete details. When an array parameter is referenced as

`$$name' (with no subscript) it evaluates to `$$name[[**]]', unless the

KKSSHHAARRRRAAYYSS option is set in which case it evaluates to `$${{name[[00]]}}'

(for an associative array, this means the value of the key `00', which may not exist even if there are values for other keys). A subscript of the form `[[exp1,,exp2]]' selects all elements in the range exp1 to exp2, inclusive. (Associative arrays are unordered, and so do not support ranges.) If one of the subscripts evaluates to a negative

number, say -n, then the nth element from the end of the array is used.

Thus `$$ffoooo[[-33]]' is the third element from the end of the array ffoooo, and

`$$ffoooo[[11,,-11]]' is the same as `$$ffoooo[[**]]'.

Subscripting may also be performed on non-array values, in which case

the subscripts specify a substring to be extracted. For example, if

FFOOOO is set to `ffoooobbaarr', then `eecchhoo $$FFOOOO[[22,,55]]' prints `oooobbaa'.

AArrrraayy EElleemmeenntt AAssssiiggnnmmeenntt A subscript may be used on the left side of an assignment like so: name[[exp]]==value In this form of assignment the element or range specified by exp is replaced by the expression on the right side. An array (but not an associative array) may be created by assignment to a range or element. Arrays do not nest, so assigning a parenthesized list of values to an element or range changes the number of elements in the array, shifting

the other elements to accommodate the new values. (This is not sup-

ported for associative arrays.) This syntax also works as an argument to the ttyyppeesseett command: ttyyppeesseett ""name[[exp]]""==value

The value may not be a parenthesized list in this case; only sin-

gle-element assignments may be made with ttyyppeesseett. Note that quotes are

necessary in this case to prevent the brackets from being interpreted as filename generation operators. The nnoogglloobb precommand modifier could be used instead. To delete an element of an ordinary array, assign `(())' to that element. To delete an element of an associative array, use the uunnsseett command: uunnsseett ""name[[exp]]"" SSuubbssccrriipptt FFllaaggss If the opening bracket, or the comma in a range, in any subscript expression is directly followed by an opening parenthesis, the string up to the matching closing one is considered to be a list of flags, as in `name[[((flags))exp]]'. The flags currently understood are: ww If the parameter subscripted is a scalar than this flag makes subscripting work on words instead of characters. The default word separator is whitespace. ss::string:: This gives the string that separates words (for use with the ww flag). pp Recognize the same escape sequences as the pprriinntt builtin in the string argument of a subsequent `ss' flag. ff If the parameter subscripted is a scalar than this flag makes

subscripting work on lines instead of characters, i.e. with ele-

ments separated by newlines. This is a shorthand for `ppwwss::\\nn::'. rr Reverse subscripting: if this flag is given, the exp is taken as a 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 `ww' flag is given, respec-

tively). The subscript used is the number of the matching ele-

ment, so that pairs of subscripts such as `$$ffoooo[[((rr))??,,33]]' and

`$$ffoooo[[((rr))??,,((rr))ff**]]' 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. RR Like `rr', but gives the last match. For associative arrays,

gives all possible matches. May be used for assigning to ordi-

nary array elements, but not for assigning to associative arrays. ii Like `rr', but gives the index of the match instead; this may not be combined with a second argument. On the left side of an assignment, behaves like `rr'. For associative arrays, the key part of each pair is compared to the pattern, and the first matching key found is the result. II Like `ii', but gives the index of the last match, or all possible matching keys in an associative array. kk If used in a subscript on an associative array, this flag causes the keys to be interpreted as patterns, and returns the value for the first key found where exp is matched by the key. This

flag does not work on the left side of an assignment to an asso-

ciative array element. If used on another type of parameter, this behaves like `rr'. KK On an associative array this is like `kk' but returns all values where exp is matched by the keys. On other types of parameters this has the same effect as `RR'. nn::expr:: If combined with `rr', `RR', `ii' or `II', makes them give the nth or nth last match (if expr evaluates to n). This flag is ignored when the array is associative. bb::expr:: If combined with `rr', `RR', `ii' or `II', makes them begin at the nth or nth last element, word, or character (if expr evaluates to n). This flag is ignored when the array is associative. ee This flag has no effect and for ordinary arrays is retained for backward compatibility only. For associative arrays, this flag can be used to force ** or @@ to be interpreted as a single key rather than as a reference to all values. This flag may be used on the left side of an assignment. See Parameter Expansion Flags (zshexpn(1)) for additional ways to manipulate the results of array subscripting. SSuubbssccrriipptt PPaarrssiinngg This discussion applies mainly to associative array key strings and to patterns used for reverse subscripting (the `rr', `RR', `ii', etc. flags), but it may also affect parameter substitutions that appear as part of an arithmetic expression in an ordinary subscript.

It is possible to avoid the use of subscripts in assignments to asso-

ciative array elements by using the syntax: aaaa++==((''kkeeyy wwiitthh ""**ssttrraannggee**"" cchhaarraacctteerrss'' ''vvaalluuee ssttrriinngg'')) This adds a new key/value pair if the key is not already present, and replaces the value for the existing key if it is. The basic rule to remember when writing a subscript expression is that all text between the opening `[[' and the closing `]]' is interpreted as if it were in double quotes (see zshmisc(1)). However, unlike double quotes which normally cannot nest, subscript expressions may appear

inside double-quoted strings or inside other subscript expressions (or

both!), so the rules have two important differences.

The first difference is that brackets (`[[' and `]]') must appear as bal-

anced pairs in a subscript expression unless they are preceded by a backslash (`\\'). Therefore, within a subscript expression (and unlike

true double-quoting) the sequence `\\[[' becomes `[[', and similarly `\\]]'

becomes `]]'. This applies even in cases where a backslash is not nor-

mally required; for example, the pattern `[[^^[[]]' (to match any character

other than an open bracket) should be written `[[^^\\[[]]' in a reverse-sub-

script pattern. However, note that `\\[[^^\\[[\\]]' and even `\\[[^^[[]]' mean the same thing, because backslashes are always stripped when they appear before brackets! The same rule applies to parentheses (`((' and `))') and braces (`{{' and

`}}'): they must appear either in balanced pairs or preceded by a back-

slash, and backslashes that protect parentheses or braces are removed during parsing. This is because parameter expansions may be surrounded

balanced braces, and subscript flags are introduced by balanced paren-

thesis.

The second difference is that a double-quote (`""') may appear as part

of a subscript expression without being preceded by a backslash, and therefore that the two characters `\\""' remain as two characters in the

subscript (in true double-quoting, `\\""' becomes `""'). However, because

of the standard shell quoting rules, any double-quotes that appear must

occur in balanced pairs unless preceded by a backslash. This makes it more difficult to write a subscript expression that contains an odd

number of double-quote characters, but the reason for this difference

is so that when a subscript expression appears inside true dou-

ble-quotes, one can still write `\\""' (rather than `\\\\\\""') for `""'.

To use an odd number of double quotes as a key in an assignment, use the ttyyppeesseett builtin and an enclosing pair of double quotes; to refer to the value of that key, again use double quotes:

ttyyppeesseett -AA aaaa

ttyyppeesseett ""aaaa[[oonnee\\""ttwwoo\\""tthhrreeee\\""qquuootteess]]""==QQQQQQ

pprriinntt ""$$aaaa[[oonnee\\""ttwwoo\\""tthhrreeee\\""qquuootteess]]""

It is important to note that the quoting rules do not change when a parameter expansion with a subscript is nested inside another subscript expression. That is, it is not necessary to use additional backslashes within the inner subscript expression; they are removed only once, from the innermost subscript outwards. Parameters are also expanded from the innermost subscript first, as each expansion is encountered left to right in the outer expression. A further complication arises from a way in which subscript parsing is

not different from double quote parsing. As in true double-quoting,

the sequences `\\**', and `\\@@' remain as two characters when they appear

in a subscript expression. To use a literal `**' or `@@' as an associa-

tive array key, the `ee' flag must be used:

ttyyppeesseett -AA aaaa

aaaa[[((ee))**]]==ssttaarr

pprriinntt $$aaaa[[((ee))**]]

A last detail must be considered when reverse subscripting is per-

formed. Parameters appearing in the subscript expression are first expanded and then the complete expression is interpreted as a pattern. This has two effects: first, parameters behave as if GGLLOOBBSSUUBBSSTT were on (and it cannot be turned off); second, backslashes are interpreted twice, once when parsing the array subscript and again when parsing the

pattern. In a reverse subscript, it's necessary to use four back-

slashes to cause a single backslash to match literally in the pattern. For complex patterns, it is often easiest to assign the desired pattern to a parameter and then refer to that parameter in the subscript, because then the backslashes, brackets, parentheses, etc., are seen only when the complete expression is converted to a pattern. To match the value of a parameter literally in a reverse subscript, rather than

as a pattern, use `$${{((qq))name}}' (see zshexpn(1)) to quote the expanded

value.

Note that the `kk' and `KK' flags are reverse subscripting for an ordi-

nary array, but are not reverse subscripting for an associative array! (For an associative array, the keys in the array itself are interpreted as patterns by those flags; the subscript is a plain string in that case.) One final note, not directly related to subscripting: the numeric names of positional parameters (described below) are parsed specially, so for

example `$$22ffoooo' is equivalent to `$${{22}}ffoooo'. Therefore, to use sub-

script syntax to extract a substring from a positional parameter, the

expansion must be surrounded by braces; for example, `$${{22[[33,,55]]}}' evalu-

ates to the third through fifth characters of the second positional

parameter, but `$$22[[33,,55]]' is the entire second parameter concatenated

with the filename generation pattern `[[33,,55]]'. PPOOSSIITTIIOONNAALL PPAARRAAMMEETTEERRSS

The positional parameters provide access to the command-line arguments

of a shell function, shell script, or the shell itself; see the section `Invocation', and also the section `Functions'. The parameter n, where n is a number, is the nth positional parameter. The parameters **, @@ and aarrggvv are arrays containing all the positional parameters; thus

`$$aarrggvv[[n]]', etc., is equivalent to simply `$$n'.

Positional parameters may be changed after the shell or function starts by using the sseett builtin, by assigning to the aarrggvv array, or by direct

assignment of the form `n==value' where n is the number of the posi-

tional parameter to be changed. This also creates (with empty values) any of the positions from 1 to n that do not already have values. Note

that, because the positional parameters form an array, an array assign-

ment of the form `n==((value ...))' is allowed, and has the effect of

shifting all the values at positions greater than n by as many posi-

tions as necessary to accommodate the new values. LLOOCCAALL PPAARRAAMMEETTEERRSS

Shell function executions delimit scopes for shell parameters. (Param-

eters are dynamically scoped.) The ttyyppeesseett builtin, and its alterna-

tive forms ddeeccllaarree, iinntteeggeerr, llooccaall and rreeaaddoonnllyy (but not eexxppoorrtt), can be used to declare a parameter as being local to the innermost scope.

When a parameter is read or assigned to, the innermost existing parame-

ter of that name is used. (That is, the local parameter hides any

less-local parameter.) However, assigning to a non-existent parameter,

or declaring a new parameter with eexxppoorrtt, causes it to be created in the outermost scope. Local parameters disappear when their scope ends. uunnsseett can be used to delete a parameter while it is still in scope; any outer parameter of the same name remains hidden. Special parameters may also be made local; they retain their special

attributes unless either the existing or the newly-created parameter

has the -hh (hide) attribute. This may have unexpected effects: there

is no default value, so if there is no assignment at the point the variable is made local, it will be set to an empty value (or zero in the case of integers). The following:

ttyyppeesseett PPAATTHH==//nneeww//ddiirreeccttoorryy::$$PPAATTHH

is valid for temporarily allowing the shell or programmes called from it to find the programs in //nneeww//ddiirreeccttoorryy inside a function.

Note that the restriction in older versions of zsh that local parame-

ters were never exported has been removed. PPAARRAAMMEETTEERRSS SSEETT BBYY TTHHEE SSHHEELLLL The following parameters are automatically set by the shell: !! The process ID of the last background command invoked.

## The number of positional parameters in decimal. Note that some

confusion may occur with the syntax $$##param which substitutes

the length of param. Use $${{##}} to resolve ambiguities. In par-

ticular, the sequence `$$##-...' in an arithmetic expression is

interpreted as the length of the parameter -, q.v.

AARRGGCC

Same as ##.

$$ The process ID of this shell.

- Flags supplied to the shell on invocation or by the sseett or

sseettoopptt commands. ** An array containing the positional parameters. aarrggvv Same as **. Assigning to aarrggvv changes the local positional parameters, but aarrggvv is not itself a local parameter. Deleting aarrggvv with uunnsseett in any function deletes it everywhere, although only the innermost positional parameter array is deleted (so ** and @@ in other scopes are not affected). @@ Same as aarrggvv[[@@]], even when aarrggvv is not set. ?? The exit value returned by the last command.

00 The name used to invoke the current shell. If the FFUUNNCC-

TTIIOONNAARRGGZZEERROO option is set, this is set temporarily within a shell function to the name of the function, and within a sourced script to the name of the script. ssttaattuuss Same as ??. ppiippeessttaattuuss An array containing the exit values returned by all commands in the last pipeline. The last argument of the previous command. Also, this parameter is set in the environment of every command executed to the full pathname of the command. CCPPUUTTYYPPEE The machine type (microprocessor class or machine model), as determined at run time. EEGGIIDD

The effective group ID of the shell process. If you have suffi-

cient privileges, you may change the effective group ID of the shell process by assigning to this parameter. Also (assuming sufficient privileges), you may start a single command with a different effective group ID by `((EEGGIIDD==gid;; ccoommmmaanndd))' EEUUIIDD

The effective user ID of the shell process. If you have suffi-

cient privileges, you may change the effective user ID of the shell process by assigning to this parameter. Also (assuming sufficient privileges), you may start a single command with a different effective user ID by `((EEUUIIDD==uid;; ccoommmmaanndd))' EERRRRNNOO The value of errno (see errno(3)) as set by the most recently failed system call. This value is system dependent and is intended for debugging purposes. It is also useful with the zzsshh//ssyysstteemm module which allows the number to be turned into a name or message. GGIIDD The real group ID of the shell process. If you have sufficient privileges, you may change the group ID of the shell process by

assigning to this parameter. Also (assuming sufficient privi-

leges), you may start a single command under a different group ID by `((GGIIDD==gid;; ccoommmmaanndd))' HHIISSTTCCMMDD The current history line number in an interactive shell, in

other words the line number for the command that caused $$HHIISSTTCCMMDD

to be read. HHOOSSTT The current hostname. LLIINNEENNOO The line number of the current line within the current script, sourced file, or shell function being executed, whichever was started most recently. Note that in the case of shell functions the line number refers to the function as it appeared in the

original definition, not necessarily as displayed by the ffuunncc-

ttiioonnss builtin.

LOGNAME

If the corresponding variable is not set in the environment of the shell, it is initialized to the login name corresponding to the current login session. This parameter is exported by default but this can be disabled using the ttyyppeesseett builtin. MMAACCHHTTYYPPEE The machine type (microprocessor class or machine model), as determined at compile time.

OOLLDDPPWWDD The previous working directory. This is set when the shell ini-

tializes and whenever the directory changes. OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss command. OOPPTTIINNDD The index of the last option argument processed by the ggeettooppttss command. OOSSTTYYPPEE The operating system, as determined at compile time. PPPPIIDD The process ID of the parent of the shell.

PPWWDD The present working directory. This is set when the shell ini-

tializes and whenever the directory changes. RRAANNDDOOMM

A pseudo-random integer from 0 to 32767, newly generated each

time this parameter is referenced. The random number generator can be seeded by assigning a numeric value to RRAANNDDOOMM.

The values of RRAANNDDOOMM form an intentionally-repeatable

pseudo-random sequence; subshells that reference RRAANNDDOOMM will

result in identical pseudo-random values unless the value of

RRAANNDDOOMM is referenced or seeded in the parent shell in between subshell invocations. SSEECCOONNDDSS The number of seconds since shell invocation. If this parameter is assigned a value, then the value returned upon reference will be the value that was assigned plus the number of seconds since the assignment.

Unlike other special parameters, the type of the SSEECCOONNDDSS parame-

ter can be changed using the ttyyppeesseett command. Only integer and one of the floating point types are allowed. For example,

`ttyyppeesseett -FF SSEECCOONNDDSS' causes the value to be reported as a float-

ing point number. The precision is six decimal places, although not all places may be useful. SSHHLLVVLL Incremented by one each time a new shell is started. ssiiggnnaallss An array containing the names of the signals. TTRRYYBBLLOOCCKKEERRRROORR In an aallwwaayyss block, indicates whether the preceding list of code

caused an error. The value is 1 to indicate an error, 0 other-

wise. It may be reset, clearing the error condition. See Com-

plex Commands in zshmisc(1) TTTTYY The name of the tty associated with the shell, if any. TTTTYYIIDDLLEE The idle time of the tty associated with the shell in seconds or

-1 if there is no such tty.

UUIIDD The real user ID of the shell process. If you have sufficient privileges, you may change the user ID of the shell by assigning to this parameter. Also (assuming sufficient privileges), you may start a single command under a different user ID by `((UUIIDD==uid;; ccoommmmaanndd))'

USERNAME S

The username corresponding to the real user ID of the shell process. If you have sufficient privileges, you may change the username (and also the user ID and group ID) of the shell by

assigning to this parameter. Also (assuming sufficient privi-

leges), you may start a single command under a different user-

ae ad sr D n gop D b `(USERNAME=srae; com

mmaanndd))' VVEENNDDOORR The vendor, as determined at compile time.

ZSHNAME

Expands to the basename of the command used to invoke this instance of zsh. ZZSSHHVVEERRSSIIOONN The version number of this zsh. PPAARRAAMMEETTEERRSS UUSSEEDD BBYY TTHHEE SSHHEELLLL The following parameters are used by the shell.

In cases where there are two parameters with an upper- and lowercase

form of the same name, such as ppaatthh and PPAATTHH, the lowercase form is an array and the uppercase form is a scalar with the elements of the array

joined together by colons. These are similar to tied parameters cre-

ated via `ttyyppeesseett -TT'. The normal use for the colon-separated form is

for exporting to the environment, while the array form is easier to manipulate within the shell. Note that unsetting either of the pair

will unset the other; they retain their special properties when recre-

ated, and recreating one of the pair will recreate the other.

AARRGGVV00 If exported, its value is used as the aarrggvv[[00]] of external com-

mands. Usually used in constructs like `AARRGGVV00==eemmaaccss nneetthhaacckk'.

BBAAUUDD The baud rate of the current connection. Used by the line edi-

tor update mechanism to compensate for a slow terminal by delay-

ing updates until necessary. This may be profitably set to a lower value in some circumstances, e.g. for slow modems dialing into a communications server which is connected to a host via a fast link; in this case, this variable would be set by default

to the speed of the fast link, and not the modem. This parame-

ter should be set to the baud rate of the slowest part of the link for best performance. The compensation mechanism can be turned off by setting the variable to zero. ccddppaatthh (CCDDPPAATTHH )

An array (colon-separated list) of directories specifying the

search path for the ccdd command. CCOOLLUUMMNNSS The number of columns for this terminal session. Used for printing select lists and for the line editor. DDIIRRSSTTAACCKKSSIIZZEE The maximum size of the directory stack. If the stack gets larger than this, it will be truncated automatically. This is useful with the AAUUTTOOPPUUSSHHDD option. EENNVV If the EENNVV environment variable is set when zsh is invoked as sshh

or kksshh, $$EENNVV is sourced after the profile scripts. The value of

EENNVV is subjected to parameter expansion, command substitution, and arithmetic expansion before being interpreted as a pathname. Note that EENNVV is not used unless zsh is emulating sshh or kksshh. FFCCEEDDIITT The default editor for the ffcc builtin. ffiiggnnoorree (FFIIGGNNOORREE ) An array (colon separated list) containing the suffixes of files

to be ignored during filename completion. However, if comple-

tion only generates files with suffixes in this list, then these files are completed anyway. ffppaatthh (FFPPAATTHH ) An array (colon separated list) of directories specifying the search path for function definitions. This path is searched

when a function with the -uu attribute is referenced. If an exe-

cutable file is found, then it is read and executed in the cur-

rent environment. hhiissttcchhaarrss

Three characters used by the shell's history and lexical analy-

sis mechanism. The first character signals the start of a his-

tory expansion (default `!!'). The second character signals the start of a quick history substitution (default `^^'). The third

character is the comment character (default `##').

HHIISSTTCCHHAARRSS Same as hhiissttcchhaarrss. (Deprecated.) HHIISSTTFFIILLEE The file to save the history in when an interactive shell exits. If unset, the history is not saved. HHIISSTTSSIIZZEE The maximum number of events stored in the internal history list. If you use the HHIISSTTEEXXPPIIRREEDDUUPPSSFFIIRRSSTT option, setting

this value larger than the SSAAVVEEHHIISSTT size will give you the dif-

ference as a cushion for saving duplicated history events. HHOOMMEE The default argument for the ccdd command. IIFFSS Internal field separators (by default space, tab, newline and NUL), that are used to separate words which result from command or parameter expansion and words read by the rreeaadd builtin. Any characters from the set space, tab and newline that appear in the IFS are called IFS white space. One or more IFS white space

characters or one non-IFS white space character together with

any adjacent IFS white space character delimit a field. If an IFS white space character appears twice consecutively in the IFS, this character is treated as if it were not an IFS white space character. KKEEYYTTIIMMEEOOUUTT The time the shell waits, in hundredths of seconds, for another

key to be pressed when reading bound multi-character sequences.

LLAANNGG This variable determines the locale category for any category not specifically selected via a variable starting with `LLCC'. LLCCAALLLL This variable overrides the value of the `LLAANNGG' variable and the value of any of the other variables starting with `LLCC'. LLCCCCOOLLLLAATTEE

This variable determines the locale category for character col-

lation information within ranges in glob brackets and for sort-

ing. LLCCCCTTYYPPEE

This variable determines the locale category for character han-

dling functions. LLCCMMEESSSSAAGGEESS This variable determines the language in which messages should be written. Note that zsh does not use message catalogs. LLCCNNUUMMEERRIICC This variable affects the decimal point character and thousands separator character for the formatted input/output functions and string conversion functions. Note that zsh ignores this setting when parsing floating point mathematical expressions. LLCCTTIIMMEE This variable determines the locale category for date and time formatting in prompt escape sequences. LLIINNEESS

The number of lines for this terminal session. Used for print-

ing select lists and for the line editor. LLIISSTTMMAAXX In the line editor, the number of matches to list without asking first. If the value is negative, the list will be shown if it spans at most as many lines as given by the absolute value. If set to zero, the shell asks only if the top of the listing would scroll off the screen. LLOOGGCCHHEECCKK The interval in seconds between checks for login/logout activity using the wwaattcchh parameter. MMAAIILL If this parameter is set and mmaaiillppaatthh is not set, the shell looks for mail in the specified file. MMAAIILLCCHHEECCKK The interval in seconds between checks for new mail. mmaaiillppaatthh (MMAAIILLPPAATTHH )

An array (colon-separated list) of filenames to check for new

mail. Each filename can be followed by a `??' and a message that will be printed. The message will undergo parameter expansion, command substitution and arithmetic expansion with the variable

$$ defined as the name of the file that has changed. The

default message is `YYoouu hhaavvee nneeww mmaaiill'. If an element is a directory instead of a file the shell will recursively check every file in every subdirectory of the element. mmaannppaatthh (MMAANNPPAATTHH )

An array (colon-separated list) whose value is not used by the

shell. The mmaannppaatthh array can be useful, however, since setting it also sets MMAANNPPAATTHH, and vice versa. mmoodduulleeppaatthh (MMOODDUULLEEPPAATTHH )

An array (colon-separated list) of directories that zzmmooddllooaadd

searches for dynamically loadable modules. This is initialized

to a standard pathname, usually `//uussrr//llooccaall//lliibb//zzsshh//$$ZZSSHHVVEERR-

SSIIOONN'. (The `//uussrr//llooccaall//lliibb' part varies from installation to

installation.) For security reasons, any value set in the envi-

ronment when the shell is started will be ignored. These parameters only exist if the installation supports dynamic module loading. NNUULLLLCCMMDD The command name to assume if a redirection is specified with no command. Defaults to ccaatt. For sshh/kksshh behavior, change this to

::. For ccsshh-like behavior, unset this parameter; the shell will

print an error message if null commands are entered. ppaatthh (PPAATTHH )

An array (colon-separated list) of directories to search for

commands. When this parameter is set, each directory is scanned and all files found are put in a hash table. PPOOSSTTEEDDIITT

This string is output whenever the line editor exits. It usu-

ally contains termcap strings to reset the terminal. PPRROOMMPPTT PPRROOMMPPTT22 PPRROOMMPPTT33 PPRROOMMPPTT44 Same as PPSS11, PPSS22, PPSS33 and PPSS44, respectively. pprroommpptt Same as PPSS11. PPSS11 The primary prompt string, printed before a command is read.

the default is `%%mm%%## '. It undergoes a special form of expan-

sion before being displayed; see the section `Prompt Expansion'. PPSS22

The secondary prompt, printed when the shell needs more informa-

tion to complete a command. It is expanded in the same way as

PPSS11. The default is `%%>> ', which displays any shell constructs

or quotation marks which are currently being processed. PPSS33 Selection prompt used within a sseelleecctt loop. It is expanded in

the same way as PPSS11. The default is `??## '.

PPSS44

The execution trace prompt. Default is `++%%NN::%%ii>> ', which dis-

plays the name of the current shell structure and the line num-

ber within it. In sh or ksh emulation, the default is `++ '. ppssvvaarr (PPSSVVAARR )

An array (colon-separated list) whose first nine values can be

used in PPRROOMMPPTT strings. Setting ppssvvaarr also sets PPSSVVAARR, and vice versa. RREEAADDNNUULLLLCCMMDD The command name to assume if a single input redirection is specified with no command. Defaults to mmoorree. RREEPPOORRTTTTIIMMEE

If nonnegative, commands whose combined user and system execu-

tion times (measured in seconds) are greater than this value have timing statistics printed for them. RREEPPLLYY This parameter is reserved by convention to pass string values between shell scripts and shell builtins in situations where a function call or redirection are impossible or undesirable. The rreeaadd builtin and the sseelleecctt complex command may set RREEPPLLYY, and

filename generation both sets and examines its value when evalu-

ating certain expressions. Some modules also employ RREEPPLLYY for similar purposes. rreeppllyy As RREEPPLLYY, but for array values rather than strings. RRPPRROOMMPPTT RRPPSS11

This prompt is displayed on the right-hand side of the screen

when the primary prompt is being displayed on the left. This does not work if the SSIINNGGLLEELLIINNEEZZLLEE option is set. It is expanded in the same way as PPSS11. RRPPRROOMMPPTT22 RRPPSS22

This prompt is displayed on the right-hand side of the screen

when the secondary prompt is being displayed on the left. This does not work if the SSIINNGGLLEELLIINNEEZZLLEE option is set. It is expanded in the same way as PPSS22. SSAAVVEEHHIISSTT The maximum number of history events to save in the history file. SSPPRROOMMPPTT

The prompt used for spelling correction. The sequence `%%RR'

expands to the string which presumably needs spelling correc-

tion, and `%%rr' expands to the proposed correction. All other

prompt escapes are also allowed. SSTTTTYY If this parameter is set in a command's environment, the shell

runs the ssttttyy command with the value of this parameter as argu-

ments in order to set up the terminal before executing the com-

mand. The modes apply only to the command, and are reset when it

finishes or is suspended. If the command is suspended and con-

tinued later with the ffgg or wwaaiitt builtins it will see the modes

specified by SSTTTTYY, as if it were not suspended. This (inten-

tionally) does not apply if the command is continued via `kkiillll

-CCOONNTT'. SSTTTTYY is ignored if the command is run in the back-

ground, or if it is in the environment of the shell but not explicitly assigned to in the input line. This avoids running stty at every external command by accidentally exporting it.

Also note that SSTTTTYY should not be used for window size specifi-

cations; these will not be local to the command. TTEERRMM

The type of terminal in use. This is used when looking up term-

cap sequences. An assignment to TTEERRMM causes zsh to re-initial-

ize the terminal, even if the value does not change (e.g.,

`TTEERRMM==$$TTEERRMM'). It is necessary to make such an assignment upon

any change to the terminal definition database or terminal type in order for the new settings to take effect. TTIIMMEEFFMMTT The format of process time reports with the ttiimmee keyword. The

default is `%%EE rreeaall %%UU uusseerr %%SS ssyysstteemm %%PP %%JJ'. Recognizes the

following escape sequences, although not all may be available on all systems, and some that are available may not be useful:

%%%% A `%%'.

%%UU CPU seconds spent in user mode.

%%SS CPU seconds spent in kernel mode.

%%EE Elapsed time in seconds.

%%PP The CPU percentage, computed as (100*%%UU+%%SS)/%%EE.

%%WW Number of times the process was swapped.

%%XX The average amount in (shared) text space used in Kbytes.

%%DD The average amount in (unshared) data/stack space used in

Kbytes.

%%KK The total space used (%X+%D) in Kbytes.

%%MM The maximum memory the process had in use at any time in

Kbytes.

%%FF The number of major page faults (page needed to be

brought from disk).

%%RR The number of minor page faults.

%%II The number of input operations.

%%OO The number of output operations.

%%rr The number of socket messages received.

%%ss The number of socket messages sent.

%%kk The number of signals received.

%%ww Number of voluntary context switches (waits).

%%cc Number of involuntary context switches.

%%JJ The name of this job.

A star may be inserted between the percent sign and flags print-

ing time. This cause the time to be printed in `hh::mm::ss..ttt' format (hours and minutes are only printed if they are not zero). TTMMOOUUTT If this parameter is nonzero, the shell will receive an AALLRRMM signal if a command is not entered within the specified number of seconds after issuing a prompt. If there is a trap on SSIIGGAALLRRMM, it will be executed and a new alarm is scheduled using the value of the TTMMOOUUTT parameter after executing the trap. If no trap is set, and the idle time of the terminal is not less

than the value of the TTMMOOUUTT parameter, zsh terminates. Other-

wise a new alarm is scheduled to TTMMOOUUTT seconds after the last keypress. TTMMPPPPRREEFFIIXX A pathname prefix which the shell will use for all temporary files. Note that this should include an initial part for the file name as well as any directory names. The default is `//ttmmpp//zzsshh'. wwaattcchh (WWAATTCCHH )

An array (colon-separated list) of login/logout events to

report. If it contains the single word `aallll', then all login/logout events are reported. If it contains the single word `nnoottmmee', then all events are reported as with `aallll' except

$USERNAME A ety n hs it a cnit f uenm, n

`@@' followed by a remote hostname, and a `%%' followed by a line

(tty). Any or all of these components may be present in an entry; if a login/logout event matches all of them, it is reported. WWAATTCCHHFFMMTT The format of login/logout reports if the wwaattcchh parameter is

set. Default is `%%nn hhaass %%aa %%ll ffrroomm %%mm'. Recognizes the follow-

ing escape sequences:

%%nn The name of the user that logged in/out.

%%aa The observed action, i.e. "logged on" or "logged off".

%%ll The line (tty) the user is logged in on.

%%MM The full hostname of the remote host.

%%mm The hostname up to the first `..'. If only the IP address

is available or the utmp field contains the name of an

X-windows display, the whole name is printed.

NOTE: The `%%mm' and `%%MM' escapes will work only if there

is a host name field in the utmp on your machine. Other-

wise they are treated as ordinary strings.

%%SS (%%ss)

Start (stop) standout mode.

%%UU (%%uu)

Start (stop) underline mode.

%%BB (%%bb)

Start (stop) boldface mode.

%%tt

%%@@ The time, in 12-hour, am/pm format.

%%TT The time, in 24-hour format.

%%ww The date in `day-dd' format.

%%WW The date in `mm//dd//yy' format.

%%DD The date in `yy-mm-dd' format.

%%((x::true-text::false-text))

Specifies a ternary expression. The character following

the x is arbitrary; the same character is used to sepa-

rate the text for the "true" result from that for the

"false" result. Both the separator and the right paren-

thesis may be escaped with a backslash. Ternary expres-

sions may be nested. The test character x may be any one of `ll', `nn', `mm' or `MM', which indicate a `true' result if the corresponding

escape sequence would return a non-empty value; or it may

be `aa', which indicates a `true' result if the watched user has logged in, or `false' if he has logged out. Other characters evaluate to neither true nor false; the entire expression is omitted in this case.

If the result is `true', then the true-text is formatted

according to the rules above and printed, and the

false-text is skipped. If `false', the true-text is

skipped and the false-text is formatted and printed.

Either or both of the branches may be empty, but both separators must be present in any case. WWOORRDDCCHHAARRSS

A list of non-alphanumeric characters considered part of a word

by the line editor. ZZBBEEEEPP If set, this gives a string of characters, which can use all the same codes as the bbiinnddkkeeyy command as described in the zsh/zle

module entry in zshmodules(1), that will be output to the termi-

nal instead of beeping. This may have a visible instead of an audible effect; for example, the string `\\ee[[??55hh\\ee[[??55ll' on a vt100 or xterm will have the effect of flashing reverse video on and off (if you usually use reverse video, you should use the string `\\ee[[??55ll\\ee[[??55hh' instead). This takes precedence over the NNOOBBEEEEPP option. ZZDDOOTTDDIIRR The directory to search for shell startup files (.zshrc, etc),

if not $$HHOOMMEE.

zsh 4.2.3 January 13, 2005 ZSHPARAM(1)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™