Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 340 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       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 numeri­
       cally), 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 typeset builtin.

       The  value  of  a  scalar or integer parameter may also be
       assigned by writing:


       If the integer attribute, -i, 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 Parameters' for addi­
       tional forms of assignment.

       To refer to the value of a  parameter,  write  `$name'  or
       `${name}'.  See Parameter Expansion in zshexpn(1) for com­
       plete details.

       In the parameter lists that follow, the mark  `<S>'  indi­
       cates  that  the parameter is special.  Special parameters
       cannot have their type changed or their readonly attribute
       turned  off,  and  if  a  special parameter is unset, then
       later recreated, the special properties will be  retained.
       `<Z>' indicates that the parameter does not exist when the
       shell initializes in sh or ksh emulation mode.


       To assign an array value, write one of:

              set -A 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:

              typeset -a name

       Associative  arrays must be declared before assignment, by

              typeset -A name


   Array Subscripts
       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 expansion as if it
       were surrounded by `$((...))'.  The elements are  numbered
       beginning  with  1, unless the KSH_ARRAYS option is set in
       which case they are numbered from zero.

       Subscripts may be used inside braces  used  to  delimit  a
       parameter   name,   thus   `${foo[2]}'  is  equivalent  to
       `$foo[2]'.  If the KSH_ARRAYS 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  expres­
       sions still apply, which affects the way that certain spe­
       cial 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.
       `"$foo[*]"' evaluates to `"$foo[1] $foo[2] ..."',  whereas
       `"$foo[@]"'  evaluates  to `"$foo[1]" "$foo[2]" ...'.  For
       associative arrays, `[*]' or `[@]'  evaluate  to  all  the
       values  (not  the keys, but see Subscript Flags below), in
       no particular order.  When an array  parameter  is  refer­
       enced  as  `$name'  (with  no  subscript)  it evaluates to
       `$name[*]', unless the KSH_ARRAYS option is set  in  which
       case  it  evaluates  to  `${name[0]}'  (for an associative
       array, this means the value of the key `0', 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 `$foo[-3]' is the third element from the end  of  the
       array foo, and `$foo[1,-1]' is the same as `$foo[*]'.

       Subscripting may also be performed on non-array values, in
       which case  the  subscripts  specify  a  substring  to  be
       extracted.   For  example, if FOO is set to `foobar', then
       `echo $FOO[2,5]' prints `ooba'.

       (This is not supported for associative arrays.)

       This syntax also works as an argument to the typeset  com­

              typeset "name[exp]"=value

       The  value  may  not be a parenthesized list in this case;
       only single-element assignments may be made with  typeset.
       Note that quotes are necessary in this case to prevent the
       brackets from being  interpreted  as  filename  generation
       operators.   The  noglob precommand modifier could be used

       To delete an element of an ordinary array, assign `()'  to
       that  element.   To  delete  an  element of an associative
       array, use the unset command:

              unset "name[exp]"

   Subscript Flags
       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:

       w      If the parameter subscripted is a scalar than  this
              flag  makes  subscripting  work on words instead of
              characters.  The default word separator is  whites­

              This gives the string that separates words (for use
              with the w flag).

       p      Recognize the same escape sequences  as  the  print
              builtin  in the string argument of a subsequent `s'

       f      If the parameter subscripted is a scalar than  this
              flag  makes  subscripting  work on lines instead of
              characters, i.e. with elements  separated  by  new­
              lines.  This is a shorthand for `pws:\n:'.

       r      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 `w' flag is given, respec­
              tively).  The subscript used is the number  of  the
              On  the  left  side  of an assignment, behaves like
              `r'.  For associative arrays, the key part of  each
              pair  is  compared  to  the  pattern, and the first
              matching key found is the result.

       I      Like `i', but gives the index of the last match, or
              all possible matching keys in an associative array.

       k      If used in a subscript  on  an  associative  array,
              this flag causes the keys to be interpreted as pat­
              terns, 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  associative  array element.  If used on another
              type of parameter, this behaves like `r'.

       K      On an  associative  array  this  is  like  `k'  but
              returns  all  values  where  exp  is matched by the
              keys.  On other types of parameters  this  has  the
              same effect as `R'.

              If  combined  with `r', `R', `i' or `I', makes them
              give the nth or nth last match (if  expr  evaluates
              to  n).   This  flag  is  ignored when the array is

              If combined with `r', `R', `i' or `I',  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.

       e      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.

   Subscript Parsing
       This  discussion  applies  mainly to associative array key
       strings and to patterns used for reverse subscripting (the
       `r', `R', `i', etc. flags), but it may also affect parame­
       ter substitutions that appear as  part  of  an  arithmetic
       expression in an ordinary subscript.

       The  basic  rule  to  remember  when  writing  a subscript
       normally required; for example,  the  pattern  `[^[]'  (to
       match  any character other than an open bracket) should be
       written `[^\[]' in a reverse-subscript 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 backslash, 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 parenthesis.

       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 char­
       acters `\"' 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 dou­
       ble-quote characters, but the reason for  this  difference
       is so that when a subscript expression appears inside true
       double-quotes, one  can  still  write  `\"'  (rather  than
       `\\\"') for `"'.

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

              typeset -A aa
              typeset "aa[one\"two\"three\"quotes]"=QQQ
              print "$aa[one\"two\"three\"quotes]"

       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

       A further complication arises from a  way  in  which  sub­
       script 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
       and again when parsing the pattern.   In  a  reverse  sub­
       script,  it's necessary to use four backslashes 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  com­
       plete  expression is converted to a pattern.  To match the
       value of a parameter literally  in  a  reverse  subscript,
       rather  than  as  a  pattern,  use  `${(q)name}' (see zsh­
       expn(1)) to quote the expanded value.

       Note that the `k' and `K' flags are  reverse  subscripting
       for  an  ordinary  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

       One  final note, not directly related to subscripting: the
       numeric names of positional parameters  (described  below)
       are parsed specially, so for example `$2foo' is equivalent
       to `${2}foo'.   Therefore,  to  use  subscript  syntax  to
       extract  a  substring  from  a  positional  parameter, the
       expansion must  be  surrounded  by  braces;  for  example,
       `${2[3,5]}'  evaluates  to the third through fifth charac­
       ters of the second positional parameter, but `$2[3,5]'  is
       the entire second parameter concatenated with the filename
       generation pattern `[3,5]'.


       The positional  parameters  provide  access  to  the  com­
       mand-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  argv  are arrays containing all the positional
       parameters; thus `$argv[n]', etc., is equivalent to simply

       Positional  parameters  may  be changed after the shell or
       function starts by using the set builtin, by assigning  to
       the  argv  array,  or  by  direct  assignment  of the form
       `n=value' where n is the number of the positional  parame­
       ter  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 assignment of the form `n=(value  ...)'
       is  allowed, and has the effect of shifting all the values
       at positions greater than n by as many positions as neces­
       sary to accommodate the new values.
       ermost scope.

       Local parameters disappear when their scope  ends.   unset
       can  be  used  to  delete a parameter while it is still in
       scope; any outer parameter of the same name  remains  hid­

       Special  parameters  may  also  be made local; they retain
       their special attributes unless either the existing or the
       newly-created parameter has the -h (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:

              typeset PATH=/new/directory:$PATH

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

       Note  that  the  restriction in older versions of zsh that
       local parameters were never exported has been removed.


       The following parameters  are  automatically  set  by  the

       ! <S>  The  process  ID  of  the  last  background command

       # <S>  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 particular, the
              sequence `$#-...' in an  arithmetic  expression  is
              interpreted  as the length of the parameter -, q.v.

       ARGC <S> <Z>
              Same as #.

       $ <S>  The process ID of this shell.

       - <S>  Flags supplied to the shell on invocation or by the
              set or setopt commands.

       * <S>  An array containing the positional parameters.

       argv <S> <Z>
              Same  as  *.   Assigning  to argv changes the local
              positional parameters, but argv  is  not  itself  a

       status <S> <Z>
              Same as ?.

       pipestatus <S> <Z>
              An array containing the exit values returned by all
              commands in the last pipeline.

       _ <S>  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 com­

              The machine type (microprocessor class  or  machine
              model), as determined at run time.

       EGID <S>
              The  effective  group  ID of the shell process.  If
              you have sufficient privileges, you may change  the
              effective  group ID of the shell process by assign­
              ing to this parameter.  Also  (assuming  sufficient
              privileges),  you may start a single command with a
              different effective group ID  by  `(EGID=gid;  com­

       EUID <S>
              The effective user ID of the shell process.  If you
              have sufficient  privileges,  you  may  change  the
              effective user ID of the shell process by assigning
              to this parameter.  Also (assuming sufficient priv­
              ileges), you may start a single command with a dif­
              ferent effective user ID by `(EUID=uid; command)'

       ERRNO <S>
              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 pur­

       GID <S>
              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  privileges),
              you  may  start  a single command under a different
              group ID by `(GID=gid; command)'

       HOST   The current hostname.

       LINENO <S>
              The line number of the current line within the cur­

              The machine type (microprocessor class  or  machine
              model), as determined at compile time.

       OLDPWD The  previous  working directory.  This is set when
              the shell initializes and  whenever  the  directory

       OPTARG <S>
              The  value of the last option argument processed by
              the getopts command.

       OPTIND <S>
              The index of the last option argument processed  by
              the getopts command.

       OSTYPE The  operating  system,  as  determined  at compile

       PPID <S>
              The process ID of the parent of the shell.

       PWD    The present working directory.  This  is  set  when
              the  shell  initializes  and whenever the directory

       RANDOM <S>
              A pseudo-random integer from 0 to 32767, newly gen­
              erated each time this parameter is referenced.  The
              random number generator can be seeded by  assigning
              a numeric value to RANDOM.

              The  values of RANDOM form an intentionally-repeat­
              able pseudo-random sequence; subshells that  refer­
              ence  RANDOM will result in identical pseudo-random
              values unless the value of RANDOM is referenced  or
              seeded  in  the  parent  shell  in between subshell

       SECONDS <S>
              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

              Unlike other special parameters, the  type  of  the
              SECONDS  parameter can be changed using the typeset
              command.  Only integer  and  one  of  the  floating
              point  types are allowed.  For example, `typeset -F
              SECONDS' causes the  value  to  be  reported  as  a
              floating  point number.  The precision is six deci­
              in seconds or -1 if there is no such tty.

       UID <S>
              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
              `(UID=uid; command)'

       USERNAME <S>
              The  username  corresponding to the real user ID of
              the shell process.  If you have  sufficient  privi­
              leges,  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 dif­
              ferent  username  (and  user  ID  and  group ID) by
              `(USERNAME=username; command)'

       VENDOR The vendor, as determined at compile time.

              Expands to the basename  of  the  command  used  to
              invoke this instance of zsh.

              The version number of this zsh.


       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  path  and  PATH,
       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 created via
       `typeset -T'.  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 recreated, and recre­
       ating one of the pair will recreate the other.

       ARGV0  If  exported,  its  value is used as the argv[0] of
              external commands.  Usually used in constructs like
              `ARGV0=emacs nethack'.

       BAUD   The  baud  rate of the current connection.  Used by
              the line editor update mechanism to compensate  for
              a  slow  terminal  by delaying updates until neces­
              sary.  This may be profitably set to a lower  value

       COLUMNS <S>
              The number of columns for  this  terminal  session.
              Used  for  printing  select  lists and for the line

              The maximum size of the directory  stack.   If  the
              stack  gets  larger than this, it will be truncated
              automatically.  This is useful with the  AUTO_PUSHD

       ENV    If  the ENV environment variable is set when zsh is
              invoked as sh or ksh, $ENV  is  sourced  after  the
              profile  scripts.  The value of ENV is subjected to
              parameter  expansion,  command  substitution,   and
              arithmetic  expansion before being interpreted as a
              pathname.  Note that ENV is not used unless zsh  is
              emulating sh or ksh.

       FCEDIT The default editor for the fc builtin.

       fignore <S> <Z> (FIGNORE <S>)
              An array (colon separated list) containing the suf­
              fixes of files to be ignored during  filename  com­
              pletion.   However,  if  completion  only generates
              files with suffixes in this list, then these  files
              are completed anyway.

       fpath <S> <Z> (FPATH <S>)
              An  array  (colon  separated  list)  of directories
              specifying the search  path  for  function  defini­
              tions.   This path is searched when a function with
              the -u attribute is referenced.  If  an  executable
              file  is found, then it is read and executed in the
              current environment.

       histchars <S>
              Three characters used by the  shell's  history  and
              lexical  analysis  mechanism.   The first character
              signals the start of a history  expansion  (default
              `!').   The second character signals the start of a
              quick  history  substitution  (default  `^').   The
              third  character  is the comment character (default

       HISTCHARS <S> <Z>
              Same as histchars.  (Deprecated.)

              The file to save the history in when an interactive
              shell exits.  If unset, the history is not saved.

              which result from command  or  parameter  expansion
              and words read by the read 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.

              The time the shell waits, in hundredths of seconds,
              for another key to be pressed  when  reading  bound
              multi-character sequences.

       LANG <S>
              This  variable  determines  the locale category for
              any category not specifically selected via a  vari­
              able starting with `LC_'.

       LC_ALL <S>
              This  variable  overrides  the  value of the `LANG'
              variable and the value of any of  the  other  vari­
              ables starting with `LC_'.

       LC_COLLATE <S>
              This  variable  determines  the locale category for
              character collation information  within  ranges  in
              glob brackets and for sorting.

       LC_CTYPE <S>
              This  variable  determines  the locale category for
              character handling functions.

       LC_MESSAGES <S>
              This variable determines the language in which mes­
              sages  should  be  written.  Note that zsh does not
              use message catalogs.

       LC_NUMERIC <S>
              This variable affects the decimal  point  character
              and thousands separator character for the formatted
              input/output functions and string conversion  func­
              tions.   Note  that  zsh  ignores this setting when
              parsing floating point mathematical expressions.

       LC_TIME <S>
              This variable determines the  locale  category  for
              date   and   time   formatting   in  prompt  escape

              The   interval   in   seconds  between  checks  for
              login/logout activity using the watch parameter.

       MAIL   If this parameter is set and mailpath is  not  set,
              the shell looks for mail in the specified file.

              The  interval  in  seconds  between  checks for new

       mailpath <S> <Z> (MAILPATH <S>)
              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 `You have  new
              mail'.   If  an element is a directory instead of a
              file the shell will recursively check every file in
              every subdirectory of the element.

       manpath <S> <Z> (MANPATH <S> <Z>)
              An  array (colon-separated list) whose value is not
              used by the shell.  The manpath array can  be  use­
              ful,  however,  since setting it also sets MANPATH,
              and vice versa.

       module_path <S> <Z> (MODULE_PATH <S>)
              An array (colon-separated list) of directories that
              zmodload searches for dynamically loadable modules.
              This is initialized to a standard pathname, usually
              `/usr/local/lib/zsh/$ZSH_VERSION'.             (The
              `/usr/local/lib' part varies from  installation  to
              installation.)  For security reasons, any value set
              in the environment when the shell is  started  will
              be ignored.

              These  parameters  only  exist  if the installation
              supports dynamic module loading.

       NULLCMD <S>
              The command name to  assume  if  a  redirection  is
              specified  with  no command.  Defaults to cat.  For
              sh/ksh behavior, change this to  :.   For  csh-like
              behavior,  unset  this  parameter;  the  shell will
              print  an  error  message  if  null  commands   are

       path <S> <Z> (PATH <S>)
              An  array  (colon-separated list) of directories to
              search for commands.  When this parameter  is  set,

       prompt <S> <Z>
              Same as PS1.

       PS1 <S>
              The primary prompt string, printed before a command
              is  read.   the default is `%m%# '.  It undergoes a
              special form of expansion before  being  displayed;
              see the section `Prompt Expansion'.

       PS2 <S>
              The  secondary prompt, printed when the shell needs
              more information to  complete  a  command.   It  is
              expanded  in  the  same way as PS1.  The default is
              `%_> ', which displays any shell constructs or quo­
              tation marks which are currently being processed.

       PS3 <S>
              Selection  prompt used within a select loop.  It is
              expanded in the same way as PS1.   The  default  is
              `?# '.

       PS4 <S>
              The execution trace prompt.  Default is `+%N:%i> ',
              which displays the name of the current shell struc­
              ture  and  the line number within it.  In sh or ksh
              emulation, the default is `+ '.

       psvar <S> <Z> (PSVAR <S>)
              An array (colon-separated list)  whose  first  nine
              values  can  be  used  in  PROMPT strings.  Setting
              psvar also sets PSVAR, and vice versa.

              The command name to assume if a single input  redi­
              rection  is specified with no command.  Defaults to

              If nonnegative, commands whose  combined  user  and
              system  execution  times  (measured in seconds) are
              greater than  this  value  have  timing  statistics
              printed for them.

       REPLY  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
              read builtin and the select complex command may set
              REPLY, and filename generation both sets and  exam­
              ines its value when evaluating certain expressions.
              Some modules also employ  REPLY  for  similar  pur­
              the  screen when the secondary prompt is being dis­
              played on the left.  This does not work if the SIN­
              GLELINEZLE  option  is  set.  It is expanded in the
              same way as PS2.

              The maximum number of history events to save in the
              history file.

       SPROMPT <S>
              The  prompt  used  for  spelling  correction.   The
              sequence `%R' expands to the string  which  presum­
              ably needs spelling correction, and `%r' expands to
              the proposed correction.  All other prompt  escapes
              are also allowed.

       STTY   If  this  parameter  is set in a command's environ­
              ment, the shell runs  the  stty  command  with  the
              value  of  this  parameter as arguments in order to
              set up the terminal before executing  the  command.
              The  modes apply only to the command, and are reset
              when it finishes or is suspended. If the command is
              suspended  and  continued later with the fg or wait
              builtins it will see the modes specified  by  STTY,
              as  if it were not suspended.  This (intentionally)
              does not apply if  the  command  is  continued  via
              `kill  -CONT'.   STTY  is ignored if the command is
              run in the background, or if it is in the  environ­
              ment 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 STTY should not be used for  window  size
              specifications; these will not be local to the com­

       TERM <S>
              The type of terminal in use.   This  is  used  when
              looking  up  termcap  sequences.   An assignment to
              TERM causes zsh to re-initialize the terminal, even
              if  the value does not change (e.g., `TERM=$TERM').
              It is necessary to make such an assignment upon any
              change  to the terminal definition database or ter­
              minal type in order for the new  settings  to  take

              The  format  of  process time reports with the time
              keyword.  The default is `%E real  %U user  %S sys­
              tem   %P  %J'.   Recognizes  the  following  escape

              %%     A `%'.
              ing  a  prompt.  If  there is a trap on SIGALRM, it
              will be executed and a new alarm is scheduled using
              the  value  of  the TMOUT 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
              TMOUT parameter, zsh terminates.  Otherwise  a  new
              alarm  is scheduled to TMOUT seconds after the last

              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 `/tmp/zsh'.

       watch <S> <Z> (WATCH <S>)
              An  array  (colon-separated  list)  of login/logout
              events to report.  If it contains the  single  word
              `all',  then  all login/logout events are reported.
              If it contains the single word  `notme',  then  all
              events are reported as with `all' except $USERNAME.
              An entry in this list may consist of a username, an
              `@'  followed  by a remote hostname, and a `%' fol­
              lowed by a line (tty).  Any or all of these  compo­
              nents may be present in an entry; if a login/logout
              event matches all of them, it is reported.

              The format of login/logout  reports  if  the  watch
              parameter  is  set.   Default is `%n has %a %l from
              %m'.  Recognizes the following escape sequences:

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

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

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

              %M     The full hostname of the remote host.

              %m     The  hostname  up to the first `.'.  If only
                     the IP address  is  available  or  the  utmp
                     field contains the name of an X-windows dis­
                     play, the whole name is printed.

                     NOTE: The `%m' and `%M'  escapes  will  work
                     only  if  there  is a host name field in the
                     utmp on your machine.   Otherwise  they  are
                     treated as ordinary strings.

              %S (%s)

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

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

                     Specifies a ternary expression.  The charac­
                     ter following the x is arbitrary;  the  same
                     character  is  used to separate the text for
                     the "true" result from that for the  "false"
                     result.   Both  the  separator and the right
                     parenthesis may be escaped with a backslash.
                     Ternary expressions may be nested.

                     The  test character x may be any one of `l',
                     `n', `m' or `M',  which  indicate  a  `true'
                     result  if the corresponding escape sequence
                     would return a non-empty value; or it may be
                     `a',  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.

       WORDCHARS <S>
              A list of  non-alphanumeric  characters  considered
              part of a word by the line editor.

       ZBEEP  If  set,  this  gives a string of characters, which
              can use all the same codes as the  bindkey  command
              as described in the zsh/zle module entry in zshmod­
              ules(1),  that  will  be  output  to  the  terminal
              instead  of  beeping.   This  may  have  a  visible
              instead of an  audible  effect;  for  example,  the
              string `\e[?5h\e[?5l' 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 `\e[?5l\e[?5h' instead).  This takes  prece­
              dence over the NOBEEP option.

              The  directory  to  search  for shell startup files
              (.zshrc, etc), if not $HOME.




Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.93 Seconds