home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / pdksh-src.lha / src / amiga / pdksh / ksh.man < prev    next >
Text File  |  1993-12-01  |  52KB  |  1,255 lines

  1.  
  2.  
  3.  
  4. KSH(1)                                                     KSH(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        ksh - Bourne / Korn Shell (Public Domain)
  9.  
  10. SSYYNNOOPPSSIISS
  11.        kksshh [--sstt] [--cc _c_o_m_m_a_n_d] [_f_i_l_e [_a_r_g_u_m_e_n_t _._._.]]
  12.  
  13. IINNTTRROODDUUCCTTIIOONN
  14.        This  document  only  summarizes  the  System V, release 2
  15.        shell features.  All of the System V features  except  for
  16.        ``restricted  mode''  are  implemented.  See also the BUGS
  17.        section.
  18.  
  19.        Features of the Korn shell are described in  more  detail.
  20.        Only  a  subset  of  the Korn shell features are currently
  21.        implemented.
  22.  
  23. DDEESSCCRRIIPPTTIIOONN
  24.    CCoommmmaanndd ssyynnttaaxx
  25.        The ``#'' character begins a one-line comment, unless  the
  26.        ``#''  occurs  inside  a  word.   The tokens ``;'', ``|'',
  27.        ``&'', ``;;'', ``||'', ``&&'', ``('', and ``)''  stand  by
  28.        themselves.   A  _w_o_r_d  is  a  sequence  of  any other non-
  29.        whitespace  characters,  which  may  also  contain  quoted
  30.        strings  (quote  character  are  ``''', ``"'', ```'', or a
  31.        matching ``${ }''  or  ``$(  )''  pair).   A  _n_a_m_e  is  an
  32.        unquoted  word  made up of letters, digits, or ``_''.  Any
  33.        number of whitespace characters (space and tab) may  sepa-
  34.        rate words and tokens.
  35.  
  36.        In  the  following  syntax, { ... }? indicates an optional
  37.        thing, { ... }* indicates zero or more repetitions, {  ...
  38.        | ... } indicates alternatives.
  39.  
  40.        statement:
  41.               (( list ))
  42.               {{ list ;; }}
  43.               ffoorr name { iinn { word }* }? ddoo list ;; ddoonnee
  44.               { wwhhiillee | uunnttiill } list ;; ddoo list ;; ddoonnee
  45.               iiff  list ;; tthheenn list ;; { eelliiff list ;; tthheenn list ;; }*
  46.               { eellssee list ;; }?ffii
  47.               ccaassee name iinn { (( word { || word } )) list ;;;; }* eessaacc
  48.               ffuunnccttiioonn name {{ list ;; }}
  49.               name (()) {{ list ;; }}
  50.               ttiimmee pipe
  51.               The opening parenthesis of the pattern is optional.
  52.               Redirection  may occur at the beginning or end of a
  53.               statement.
  54.  
  55.        command:
  56.               { name=word }* { word }*
  57.               Redirection may occur anywhere in a command.
  58.  
  59.        list:
  60.               cond
  61.  
  62.  
  63.  
  64.                             April 1992                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. KSH(1)                                                     KSH(1)
  71.  
  72.  
  73.               cond ;; list
  74.               cond && list
  75.  
  76.        cond:
  77.               pipe
  78.               pipe &&&& cond
  79.               pipe |||| cond
  80.  
  81.        pipe:
  82.               statement { || statement }*
  83.  
  84.    AAlliiaass eexxppaannssiioonn
  85.        Alias expansion occurs when the first word of a  statement
  86.        is  a  defined  alias,  except  when that alias is already
  87.        being expanded.  It also occurs after the expansion of  an
  88.        alias whose definition ends with a space.
  89.  
  90.    SShheellll vvaarriiaabblleess
  91.        The  following  standard special variables exist: !!, ##, $$,
  92.        --, ??.
  93.  
  94.        _      In interactive use this parameter  is  set  to  the
  95.               last  word of the previous command.  When a command
  96.               is executed this parameter is set to the full  path
  97.               of  the  command  and placed in the environment for
  98.               the command.  See also MMAAIILLPPAATTHH.
  99.  
  100.        CDPATH The search path for the _c_d command.
  101.  
  102.        ENV    If this variable is set at start-up (after any pro-
  103.               file  files  are  executed),  the expanded value is
  104.               used as shell start-up file.  It typically contains
  105.               function and alias definitions.
  106.  
  107.        FCEDIT The  editor used by the _f_c command.  During startup
  108.               the shell checks the value of  FFCCEEDDIITT,  EEDDIITTOORR  and
  109.               finally  VVIISSUUAALL  to  try  and determin what command
  110.               line edit mode to  use.   Note  that  this  is  not
  111.               strictly ksh compatible behaviour.
  112.  
  113.        IFS    _I_n_t_e_r_n_a_l  _f_i_e_l_d _s_e_p_a_r_a_t_o_r, used during substitution
  114.               and the _r_e_a_d command.
  115.  
  116.        HOME   The default directory for the _c_d command.
  117.  
  118.        MAIL   If set, the user will be informed of the arrival of
  119.               mail  in  the named file.  This variable is ignored
  120.               if the MMAAIILLPPAATTHH variable is set.
  121.  
  122.        MAILCHECK
  123.               How often, in seconds, the  shell  will  check  for
  124.               mail  in the file(s) specified by MMAAIILL or MMAAIILLPPAATTHH.
  125.               If 0, the shell checks  before  each  prompt.   The
  126.               default is 600 seconds.
  127.  
  128.  
  129.  
  130.                             April 1992                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. KSH(1)                                                     KSH(1)
  137.  
  138.  
  139.        MAILPATH
  140.               A  list  of files to be checked for mail.  The list
  141.               is colon separated, and each file may  be  followed
  142.               by  a ?? and a message to be printed if new mail has
  143.               arrived.  Command  and  parameter  substitution  is
  144.               performed  on  the message, and the parameter $$__ is
  145.               set to the name of the file.  The  default  message
  146.               is ``you have mail in $_''.
  147.  
  148.        PATH   The  search  path  for  executable commands and ..'d
  149.               files.
  150.  
  151.        PPID   The process number of the parent of the shell.
  152.  
  153.        PS1 PS2
  154.               PPSS11 is the primary prompt for  interactive  shells.
  155.               Dollar substitution is performed, and !! is replaced
  156.               with the command number (see _f_c).
  157.  
  158.        PWD OLDPWD
  159.               The current and previous working directories.
  160.  
  161.        RANDOM A random integer.  The random number generator  may
  162.               be  seeded  by  assigning  an integer value to this
  163.               variable.
  164.  
  165.        SECONDS
  166.               The number of seconds since  the  shell  timer  was
  167.               started  or  reset.   Assigning an integer value to
  168.               this variable resets the timer.
  169.  
  170.        COLUMNS
  171.               The width to use for the commandline editing (emacs
  172.               mode only).
  173.  
  174.        HISTFILE
  175.               The  name of the file to read initial history from.
  176.               The default is "$$HHOOMMEE//..ppddkksshh__hhiisstt".  When the shell
  177.               exits  it will overwrite this file with its current
  178.               history.   This  behaviour  will  almost  certainly
  179.               cause  grief  when multiple shells are being run by
  180.               the same user.   Making  the  file  read-only  will
  181.               allow  each  shell  to start with a set history and
  182.               avoid overwriting the file.
  183.  
  184.        HISTSIZE
  185.               The number of history items to save in HHIISSTTFFIILLEE.
  186.  
  187.    SSuubbssttiittuuttiioonn
  188.        In addition to the System Vr2 substitutions, the following
  189.        are available.
  190.  
  191.        $(command)
  192.               Like `command`, but no escapes are recognized.
  193.  
  194.  
  195.  
  196.                             April 1992                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. KSH(1)                                                     KSH(1)
  203.  
  204.  
  205.        $(<file)
  206.               Equivalent to $(cat file), but without forking.
  207.  
  208.        ${#var}
  209.               The  length of the string value of _v_a_r, or the num-
  210.               ber of arguments if _v_a_r is ** or @@.
  211.  
  212.        ${var#pattern} ${var##pattern}
  213.               If _p_a_t_t_e_r_n matches the beginning of  the  value  of
  214.               _v_a_r, the matched text is deleted from the result of
  215.               substitution.  A single ## results in  the  shortest
  216.               match, two ##'s results in the longest match.
  217.  
  218.        ${var%pattern} ${var%%pattern}
  219.               Like ## substition, but deleting from the end of the
  220.               value.
  221.  
  222.    EExxpprreessssiioonnss
  223.        Expressions can be used with the lleett command,  as  numeric
  224.        arguments  to  the  tteesstt  command,  and as the value of an
  225.        assignment to an integer variable.
  226.  
  227.        Expression may contain alpha-numeric variable  identifiers
  228.        and integer constants and may be combined with the follow-
  229.        ing operators:
  230.  
  231.        == != <= < > >= + - * / % ! ( )
  232.  
  233.    CCoommmmaanndd eexxeeccuuttiioonn
  234.        After evaluation of keyword assignments and arguments, the
  235.        type  of  command  is determined.  A command may execute a
  236.        shell function, a shell built-in, or an executable file.
  237.  
  238.        Any keyword assignments are then  performed  according  to
  239.        the  type  of  command.  In function calls assignments are
  240.        local to the function.  Assignments in  built-in  commands
  241.        marked  with  a   persist,  otherwise  they are temporary.
  242.        Assignments in executable commands  are  exported  to  the
  243.        sub-process executing the command.
  244.  
  245.        Even  on  systems where the exec() family does not support
  246.        #!  notation for scripts, ksh can be  configured  to  fake
  247.        it.
  248.  
  249.        There are several built-in commands.
  250.  
  251.        :      Only  expansion and assignment are performed.  This
  252.               is the default if a command has no arguments.
  253.  
  254.        . _f_i_l_e Execute the commands in _f_i_l_e without forking.   The
  255.               file  is  searched  in  the  directories  of $PATH.
  256.               Passing arguments is not implemented.
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                             April 1992                          4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. KSH(1)                                                     KSH(1)
  269.  
  270.  
  271.        alias [_n_a_m_e==_v_a_l_u_e _._._._]
  272.               Without arguments,  aalliiaass  lists  all  aliases  and
  273.               their  values.   For  any name without a value, its
  274.               value is listed.  Any name with a value defines  an
  275.               alias, see "Alias Expansion" above.  Korn's tracked
  276.               aliases are not implemented, but System  V  command
  277.               hashing is (see "hash").
  278.  
  279.        alias -d [_n_a_m_e==_v_a_l_u_e _._._._]
  280.               Directory aliases for tilde expansion, eg.
  281.               alias -d fac=/usr/local/usr/facilities
  282.               cd ~fac/bin
  283.  
  284.        break [_l_e_v_e_l_s]
  285.  
  286.        builtin _c_o_m_m_a_n_d _a_r_g _._._.
  287.               _C_o_m_m_a_n_d is executed as a built-in command.
  288.  
  289.        cd [_p_a_t_h]
  290.               Set  the working directory to _p_a_t_h.  If the parame-
  291.               ter CDPATH is set, it lists the search path for the
  292.               directory  containing  _p_a_t_h.  A null path means the
  293.               current directory.  If _p_a_t_h is  missing,  the  home
  294.               directory  ($HOME) is used.  If _p_a_t_h is --, the pre-
  295.               vious working directory is used.  If  _p_a_t_h  is  ....,
  296.               the  shell  changes  directory to the parent direc-
  297.               tory, as determined from the value of PWD.  The PWD
  298.               and OLDPWD variables are reset.
  299.  
  300.        cd _o_l_d _n_e_w
  301.               The  string  _n_e_w is substituted for _o_l_d in the cur-
  302.               rent directory, and the shell attempts to change to
  303.               the new directory.
  304.  
  305.        continue [_l_e_v_e_l_s]
  306.  
  307.        echo ...
  308.               _E_c_h_o is replaced with the alias echo='print' in the
  309.               Korn shell.
  310.  
  311.        eval _c_o_m_m_a_n_d _._._.
  312.  
  313.        exec _c_o_m_m_a_n_d _a_r_g _._._.
  314.               The executable command is executed without forking.
  315.               If  no  arguments  are given, any IO redirection is
  316.               permanent.
  317.  
  318.        exit [_s_t_a_t_u_s]
  319.  
  320.        fc [--ee _e_d_i_t_o_r] [--llnnrr] [_f_i_r_s_t [_l_a_s_t]]
  321.               _F_i_r_s_t and _l_a_s_t select commands.   Commands  can  be
  322.               selected  by  history number, or a string specifing
  323.               the most recent command starting with that  string.
  324.               The  --ll  option lists the command on stdout, and --nn
  325.  
  326.  
  327.  
  328.                             April 1992                          5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. KSH(1)                                                     KSH(1)
  335.  
  336.  
  337.               inhibits  the  default  command  numbers.   The  --rr
  338.               option reverses the order of the list.  Without --ll,
  339.               the selected commands can be edited by  the  editor
  340.               specified with the --ee option, or if no --ee is speci-
  341.               fied, the $$FFCCEEDDIITT  editor,  then  executed  by  the
  342.               shell.
  343.  
  344.        fc --ee -- [--gg] [_o_l_d==_n_e_w] [_c_o_m_m_a_n_d]
  345.               Re-execute  the selected command (the previous com-
  346.               mand by default) after performing the optional sub-
  347.               stitution of _o_l_d with _n_e_w.  If --gg is specified, all
  348.               occurrences of _o_l_d are  replaced  with  _n_e_w.   This
  349.               command  is  usually  accessed  with the predefined
  350.               alias r=``fc -e -''.
  351.  
  352.        getopts
  353.               See the attached manual page.
  354.  
  355.        hash [--rr] [_n_a_m_e _._._.]
  356.               Without arguments, any  hashed  executable  command
  357.               pathnames  are  listed.   The  --rr  flag  causes all
  358.               hashed  commands  to  be  removed.   Each  _n_a_m_e  is
  359.               searched  as if it were a command name and added to
  360.               the hash table if it is an executable command.
  361.  
  362.        kill [--_s_i_g_n_a_l] _p_r_o_c_e_s_s ...
  363.               Send a signal (TERM by default) to the  named  pro-
  364.               cess.  The signal may be specified as a number or a
  365.               mnemonic  from  <signal.h>  with  the  SIG   prefix
  366.               removed.
  367.  
  368.        let [_e_x_p_r_e_s_s_i_o_n _._._.]
  369.               Each  expression  is  evaluated,  see "Expressions"
  370.               above.  A zero  status  is  returned  if  the  last
  371.               expression evaluates to a non-zero value, otherwise
  372.               a non-zero status is returned.  Since  may  expres-
  373.               sions  need  to  be quoted, _(_( _e_x_p_r _)_) is syntactic
  374.               sugar for _l_e_t _"_e_x_p_r_".
  375.  
  376.        print [--nnrreeuu_n] [_a_r_g_u_m_e_n_t _._._.]
  377.               PPrriinntt prints its arguments on the standard  output,
  378.               separated by spaces, and terminated with a newline.
  379.               The --nn option eliminates the newline.
  380.  
  381.               By  default,  certain  C  escapes  are  translated.
  382.               These  include  \b, \f, \n, \r, \t, \v, and \### (#
  383.               is an octal digit).  \c is  equivalent  to  the  --nn
  384.               option.   This expansion may be inhibitted with the
  385.               --rr option, and may be re-enabled with the  addition
  386.               of the --ee option.
  387.  
  388.        read [--rruu_n] _n_a_m_e _._._.
  389.               The   first  variable  name  may  be  of  the  form
  390.               _n_a_m_e??_p_r_o_m_p_t.
  391.  
  392.  
  393.  
  394.                             April 1992                          6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. KSH(1)                                                     KSH(1)
  401.  
  402.  
  403.        readonly [_n_a_m_e _._._.]
  404.  
  405.        return [_s_t_a_t_u_s]
  406.  
  407.        set [++--_[_a_-_z_]] [++--oo _k_e_y_w_o_r_d] ...
  408.               Set (--) or clear (++) a shell option:
  409.                    -a   allexport           all new variable  are
  410.               created with export attribute
  411.                    -e   errexit             exit on non-zero sta-
  412.               tus [incorrect]
  413.                         bgnice              background  jobs  are
  414.               run with lower priority
  415.  
  416.                         emacs               BRL  emacs-like  line
  417.               editing
  418.                         ignoreeof           shell will  not  exit
  419.               of EOF, must use _e_x_i_t
  420.                    -k   keyword             variable  assignments
  421.               are recognized anywhere in command
  422.                         markdirs            [not implemented]
  423.                    -m   monitor             job  control  enabled
  424.               (default for interactive shell)
  425.                    -n   noexec              compile  input but do
  426.               not execute (ignored if interactive)
  427.                    -f   noglob              don't  expand   file-
  428.               names
  429.                    -u   nounset             dollar  expansion  of
  430.               unset variables is an error
  431.                    -v   verbose             echo  shell  commands
  432.               on stdout when compiling
  433.                    -h   trackall            add command pathnames
  434.               to hash table
  435.                         vi                  VI-like line editing
  436.                    -x   xtrace              echo simple  commands
  437.               while executing
  438.  
  439.        set [----] _a_r_g _._._.
  440.               Set shell arguments.
  441.  
  442.        shift [_n_u_m_b_e_r]
  443.  
  444.        test   See the attached manual page.
  445.  
  446.        times
  447.  
  448.        trap [_h_a_n_d_l_e_r] [_s_i_g_n_a_l _._._.]
  449.  
  450.        typeset [++--iirrttxx] [_n_a_m_e[==_v_a_l_u_e] ...]
  451.               If  no arguments are given, lists all variables and
  452.               their attributes.
  453.  
  454.        If options but no names are given,  lists  variables  with
  455.        specified  attributes, and their values if unless ``+'' is
  456.        used.
  457.  
  458.  
  459.  
  460.                             April 1992                          7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. KSH(1)                                                     KSH(1)
  467.  
  468.  
  469.        If names are given, set the attributes of the named  vari-
  470.        ables.   Variables  may also be assigned a value.  If used
  471.        inside a function, the created variable are local  to  the
  472.        function.
  473.  
  474.        The  attributes are as follows.  -iThe variable's value is
  475.        stored as an integer.
  476.        -xThe variable is exported to the enviroment.
  477.        -rThe variable is read-only cannot be reassigned a  value.
  478.        -tTrace (not implemented).
  479.        -fList functions instead of variable.
  480.  
  481.        uulliimmiitt [ --<<OOZZ>> ] [ _n ]
  482.  
  483.               --cc   Impose a size limit of _n blocks on the size of
  484.                    core dumps.
  485.  
  486.               --dd   Impose a size limit of _n blocks on the size of
  487.                    the data area.
  488.  
  489.               --ff   Impose a size limit of _n blocks on files writ-
  490.                    ten by  the  shell  and  its  child  processes
  491.                    (files of any size may be read).
  492.  
  493.               --mm   Impose a soft limit of _n blocks on the size of
  494.                    physical memory.
  495.  
  496.               --tt   Impose a time limit of _n seconds to be used by
  497.                    each process.
  498.  
  499.               If  no  option  is  given,  --ff is assumed.  If _n is
  500.               omitted, the current limit is printed.  As  far  as
  501.               uulliimmiitt is concerned, a ``block'' is 512 bytes.
  502.  
  503.               You  may  lower your own resource limit, but only a
  504.               super-user (see _s_u(1M)) can raise a limit.
  505.  
  506.        umask [_v_a_l_u_e]
  507.  
  508.        unalias _n_a_m_e _._._.
  509.               The aliases for the given names are removed.
  510.  
  511.        unset [--ff] _n_a_m_e _._._.
  512.  
  513.        wait [_p_r_o_c_e_s_s_-_i_d]
  514.  
  515.        whence [--vv] name ...
  516.               For each name, the type of command is listed.   The
  517.               --vv  flag  causes  function  and  alias values to be
  518.               listed.
  519.  
  520.    JJoobb CCoonnttrrooll
  521.        Job control features are enabled by the --mm or  --oo  mmoonniittoorr
  522.        flags.   When  job  control  is  enabled,  and  the system
  523.  
  524.  
  525.  
  526.                             April 1992                          8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. KSH(1)                                                     KSH(1)
  533.  
  534.  
  535.        supports job control, background commands  and  foreground
  536.        commands that have been stopped (usually by a SIGTSTP sig-
  537.        nal generated by typing _^_Z) are placed into separate indi-
  538.        vidual _p_r_o_c_e_s_s _g_r_o_u_p_s.  The following commands are used to
  539.        manipulate these process groups:
  540.  
  541.        jjoobbss           Display information  about  the  controlled
  542.                       jobs.  The job number is given preceeded by
  543.                       a percent sign, followed by a plus sign  if
  544.                       it  is  the  ``current job'', or by a minus
  545.                       sign if it is the  ``previous  job'',  then
  546.                       the  process group number for the job, then
  547.                       the command.
  548.        kkiillll [--_s_i_g_n_a_l] _j_o_b ...
  549.                       Send a signal  (TERM  by  default)  to  the
  550.                       named job process group.
  551.        ffgg [ _j_o_b ]     Resume  the  stopped  foreground job in the
  552.                       foreground.  If the process group _n is  not
  553.                       specified   then  the  ``current  job''  is
  554.                       resumed.
  555.        bbgg [ _j_o_b ]     Resume the stopped foreground  job  in  the
  556.                       background.   If the process group _n is not
  557.                       specified  then  the  ``current  job''   is
  558.                       resumed.
  559.  
  560.        The ffgg, bbgg, kkiillll, and wwaaiitt commands may refer to jobs with
  561.        the following ``percent'' sequences.  The percent sign  is
  562.        optional with the fg and bg commands.
  563.  
  564.        %%++(%%--)     If  there  is  a  ``current  job''  (``previous
  565.                   job''), then that job is selected.
  566.        %%_n         If the specified job number is one of the known
  567.                   jobs, then that job is selected.
  568.        %%_s_t_r_i_n_g    If  the  string  matches  the initial part of a
  569.                   job's command, then that job is selected.
  570.        %%??_s_t_r_i_n_g   As above, but the string may match any  portion
  571.                   of the command.
  572.  
  573.        If  the  system does not support job control, monitor mode
  574.        enables job reporting.  The jobs and kill  commands  func-
  575.        tions  as  above, and you will be informed when background
  576.        jobs complete.  Fg and bg are not availiable.
  577.  
  578.    IInntteerraaccttiivvee IInnppuutt LLiinnee EEddiittiinngg
  579.        When the eemmaaccss option is set, interactive input line edit-
  580.        ing  is enabled.  This mode is slightly different from the
  581.        emacs mode in AT&T's  KornShell.   In  this  mode  various
  582.        _e_d_i_t_i_n_g  _c_o_m_m_a_n_d_s  (typically bound to one or more control
  583.        characters) cause immediate actions without waiting for  a
  584.        new-line.   Several _e_d_i_t_i_n_g _c_o_m_m_a_n_d_s are bound to particu-
  585.        lar control characters when the shell  is  invoked;  these
  586.        bindings can be changed using the following commands:
  587.  
  588.        bbiinndd                The current bindings are listed.
  589.  
  590.  
  591.  
  592.                             April 1992                          9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. KSH(1)                                                     KSH(1)
  599.  
  600.  
  601.        bbiinndd [ _s_t_r_i_n_g ] = [ _e_d_i_t_i_n_g_-_c_o_m_m_a_n_d ]
  602.                            The specified _e_d_i_t_i_n_g _c_o_m_m_a_n_d is bound
  603.                            to the given _s_t_r_i_n_g, which should con-
  604.                            sist of a control character (which may
  605.                            be written  using  ``caret  notation''
  606.                            ^^_x), optionally preceded by one of the
  607.                            two prefix characters.   Future  input
  608.                            of  the  _s_t_r_i_n_g will cause the _e_d_i_t_i_n_g
  609.                            _c_o_m_m_a_n_d to be immediately invoked.
  610.                            Note that  although  only  two  prefix
  611.                            characters  (normal  ESC  and  ^X) are
  612.                            supported,    some     multi-character
  613.                            sequences can be supported:
  614.                            bind '^[['=prefix-2
  615.                            bind '^XA'=up-history
  616.                            bind '^XB'=down-history
  617.                            bind '^XC'=forward-char
  618.                            bind '^XC'=backward-char
  619.                            will  bind  the  arrow keys on an ANSI
  620.                            terminal.   Of  course   some   escape
  621.                            sequences  won't  work  out quite that
  622.                            nicely.
  623.        bbiinndd --mm [ _s_t_r_i_n_g ] = [ _s_u_b_s_t_i_t_u_t_e ]
  624.                            The specified input _s_t_r_i_n_g will after-
  625.                            wards  be  immediately replaced by the
  626.                            given  _s_u_b_s_t_i_t_u_t_e  string,  which  may
  627.                            contain _e_d_i_t_i_n_g _c_o_m_m_a_n_d_s.
  628.  
  629.        The  following  _e_d_i_t_i_n_g  _c_o_m_m_a_n_d_s are available; first the
  630.        command name is given followed by its default binding  (if
  631.        any) using caret notation (note that the ASCII ESC charac-
  632.        ter is written as ^[), then the editing function performed
  633.        is  decribed.   Note  that  _e_d_i_t_i_n_g _c_o_m_m_a_n_d names are used
  634.        only with the bbiinndd  command.   Furthermore,  many  _e_d_i_t_i_n_g
  635.        _c_o_m_m_a_n_d_s  are useful only on terminals with a visible cur-
  636.        sor.  The default bindings were chosen to resemble  corre-
  637.        sponding  EMACS  key  bindings.   The users tty characters
  638.        (eg. erase) are bound to reasonable substitutes.
  639.  
  640.        aabboorrtt  ^^GG                       Useful as a response to  a
  641.                                        request   for   a  sseeaarrcchh--
  642.                                        hhiissttoorryy pattern  in  order
  643.                                        to abort the search.
  644.        aauuttoo--iinnsseerrtt                     Simply  causes the charac-
  645.                                        ter to appear  as  literal
  646.                                        input.    (Most   ordinary
  647.                                        characters  are  bound  to
  648.                                        this.)
  649.        bbaacckkwwaarrdd--cchhaarr  ^^BB               Moves  the cursor backward
  650.                                        one character.
  651.        bbaacckkwwaarrdd--wwoorrdd  ^^[[bb              Moves the cursor  backward
  652.                                        to   the  beginning  of  a
  653.                                        word.
  654.        bbeeggiinnnniinngg--ooff--lliinnee  ^^AA           Moves the  cursor  to  the
  655.  
  656.  
  657.  
  658.                             April 1992                         10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. KSH(1)                                                     KSH(1)
  665.  
  666.  
  667.                                        beginning   of  the  input
  668.                                        line  (after  the   prompt
  669.                                        string).
  670.        ccoommpplleettee  ^^[[^^[[                  Automatically completes as
  671.                                        much as is unique  of  the
  672.                                        hashed command name or the
  673.                                        file name  containing  the
  674.                                        cursor.    If  the  entire
  675.                                        remaining command or  file
  676.                                        name  is unique a space is
  677.                                        printed after its  comple-
  678.                                        tion,   unless   it  is  a
  679.                                        directory  name  in  which
  680.                                        case  // is postpended.  If
  681.                                        there is no hashed command
  682.                                        or file name with the cur-
  683.                                        rent partial word  as  its
  684.                                        prefix,  a  bell character
  685.                                        is output (usually causing
  686.                                        a ``beep'').
  687.        ccoommpplleettee--ccoommmmaanndd  ^^XX^^[[          Automatically completes as
  688.                                        much as is unique  of  the
  689.                                        hashed command name having
  690.                                        the partial word up to the
  691.                                        cursor  as  its prefix, as
  692.                                        in  the  ccoommpplleettee  command
  693.                                        described   above.    Only
  694.                                        command and function names
  695.                                        seen  since  the last hhaasshh
  696.                                        --rr command  are  available
  697.                                        for  completion;  the hhaasshh
  698.                                        command  may  be  used  to
  699.                                        register additional names.
  700.        ccoommpplleettee--ffiillee  ^^[[^^XX             Automatically completes as
  701.                                        much  as  is unique of the
  702.                                        file name having the  par-
  703.                                        tial word up to the cursor
  704.                                        as its prefix, as  in  the
  705.                                        ccoommpplleettee command described
  706.                                        above.
  707.        ccooppyy--llaasstt--aarrgg  ^^[[__              The last word of the  pre-
  708.                                        vious  command is inserted
  709.                                        at the cursor.   Note  I/O
  710.                                        redirections  do not count
  711.                                        as words of the command.
  712.        ddeelleettee--cchhaarr--bbaacckkwwaarrdd  EERRAASSEE     Deletes   the    character
  713.                                        before the cursor.
  714.        ddeelleettee--cchhaarr--ffoorrwwaarrdd             Deletes    the   character
  715.                                        after the cursor.
  716.        ddeelleettee--wwoorrdd--bbaacckkwwaarrdd  ^^[[EERRAASSEE   Deletes characters  before
  717.                                        the  cursor  back  to  the
  718.                                        beginning of a word.
  719.        ddeelleettee--wwoorrdd--ffoorrwwaarrdd  ^^[[dd        Deletes  characters  after
  720.                                        the  cursor  up to the end
  721.  
  722.  
  723.  
  724.                             April 1992                         11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. KSH(1)                                                     KSH(1)
  731.  
  732.  
  733.                                        of a word.
  734.        ddoowwnn--hhiissttoorryy  ^^NN                Scrolls the history buffer
  735.                                        forward  one line (later).
  736.                                        Each input line originally
  737.                                        starts just after the last
  738.                                        entry   in   the   history
  739.                                        buffer, so ddoowwnn--hhiissttoorryy is
  740.                                        not  useful  until  either
  741.                                        sseeaarrcchh--hhiissttoorryy    or   uupp--
  742.                                        hhiissttoorryy  has   been   per-
  743.                                        formed.
  744.        eenndd--ooff--lliinnee  ^^EE                 Moves  the  cursor  to the
  745.                                        end of the input line.
  746.        eeoott  ^^__                         Acts  as  an  end-of-file;
  747.                                        this   is  useful  because
  748.                                        edit-mode  input  disables
  749.                                        normal    terminal   input
  750.                                        canonicalization.
  751.        eeoott--oorr--ddeelleettee  ^^DD               Acts as eot if alone on  a
  752.                                        line;  otherwise  acts  as
  753.                                        delete-char-forward.
  754.        eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk  ^^XX^^XX   Places  the  cursor  where
  755.                                        the  mark is, and sets the
  756.                                        mark to where  the  cursor
  757.                                        was.
  758.        ffoorrwwaarrdd--cchhaarr  ^^FF                Moves  the  cursor forward
  759.                                        one position.
  760.        ffoorrwwaarrdd--wwoorrdd  ^^[[ff               Moves the  cursor  forward
  761.                                        to the end of a word.
  762.        kkiillll--lliinnee  KKIILLLL                 Deletes  the  entire input
  763.                                        line.
  764.        kkiillll--ttoo--eeooll  ^^KK                 Deletes the input from the
  765.                                        cursor  to  the end of the
  766.                                        line.
  767.        kkiillll--rreeggiioonn  ^^WW                 Deletes the input  between
  768.                                        the cursor and the mark.
  769.        lliisstt  ^^[[??                       Prints  a  sorted,  colum-
  770.                                        nated list of hashed  com-
  771.                                        mand  names  or file names
  772.                                        (if any) that can complete
  773.                                        the  partial word contain-
  774.                                        ing the cursor.  Directory
  775.                                        names have // postpended to
  776.                                        them, and executable  file
  777.                                        names are followed by **.
  778.        lliisstt--ccoommmmaanndd  ^^XX??               Prints  a  sorted,  colum-
  779.                                        nated list of hashed  com-
  780.                                        mand  names  (if any) that
  781.                                        can complete  the  partial
  782.                                        word  containing  the cur-
  783.                                        sor.
  784.        lliisstt--ffiillee                       Prints  a  sorted,  colum-
  785.                                        nated  list  of file names
  786.                                        (if any) that can complete
  787.  
  788.  
  789.  
  790.                             April 1992                         12
  791.  
  792.  
  793.  
  794.  
  795.  
  796. KSH(1)                                                     KSH(1)
  797.  
  798.  
  799.                                        the  partial word contain-
  800.                                        ing the cursor.  File type
  801.                                        indicators  are postpended
  802.                                        as  described  under  lliisstt
  803.                                        above.
  804.        nneewwlliinnee  ^^JJ _a_n_d ^^MM              Causes  the  current input
  805.                                        line to  be  processed  by
  806.                                        the  shell.   (The current
  807.                                        cursor  position  may   be
  808.                                        anywhere on the line.)
  809.        nneewwlliinnee--aanndd--nneexxtt  ^^OO            Causes  the  current input
  810.                                        line to  be  processed  by
  811.                                        the  shell,  and  the next
  812.                                        line from history  becomes
  813.                                        the current line.  This is
  814.                                        only useful after  an  up-
  815.                                        history or search-history.
  816.        nnoo--oopp  QQUUIITT                     Does nothing.
  817.        pprreeffiixx--11  ^^[[                    Introduces  a  2-character
  818.                                        command sequence.
  819.        pprreeffiixx--22  ^^XX                    Introduces  a  2-character
  820.                                        command sequence.
  821.        qquuoottee  ^^^^                       The following character is
  822.                                        taken   literally   rather
  823.                                        than as  an  _e_d_i_t_i_n_g  _c_o_m_-
  824.                                        _m_a_n_d.
  825.        rreeddrraaww  ^^LL                      Reprints the prompt string
  826.                                        and  the   current   input
  827.                                        line.
  828.        sseeaarrcchh--cchhaarraacctteerr  ^^]]            Search forward in the cur-
  829.                                        rent  line  for  the  next
  830.                                        keyboard character.
  831.        sseeaarrcchh--hhiissttoorryy  ^^RR              Enter  incremental  search
  832.                                        mode.  The  internal  his-
  833.                                        tory   list   is  searched
  834.                                        backwards   for   commands
  835.                                        matching  the  input.   An
  836.                                        initial   ``^''   in   the
  837.                                        search  string anchors the
  838.                                        search.   The  escape  key
  839.                                        will  leave  search  mode.
  840.                                        Other  commands  will   be
  841.                                        executed   after   leaving
  842.                                        search  mode  (unless   of
  843.                                        course  they  are prefixed
  844.                                        by escape, in  which  case
  845.                                        they will almost certainly
  846.                                        do the wrong thing).  Suc-
  847.                                        cessive     sseeaarrcchh--hhiissttoorryy
  848.                                        commands continue  search-
  849.                                        ing  backward  to the next
  850.                                        previous occurrence of the
  851.                                        pattern.     The   history
  852.                                        buffer  retains   only   a
  853.  
  854.  
  855.  
  856.                             April 1992                         13
  857.  
  858.  
  859.  
  860.  
  861.  
  862. KSH(1)                                                     KSH(1)
  863.  
  864.  
  865.                                        finite  number  of  lines;
  866.                                        the oldest  are  discarded
  867.                                        as necessary.
  868.        sseett--mmaarrkk--ccoommmmaanndd  ^^]]<<ssppaaccee>>     Search forward in the cur-
  869.                                        rent  line  for  the  next
  870.                                        keyboard character.
  871.        ssttuuffff                           On  systems supporting it,
  872.                                        pushes the bound character
  873.                                        back   onto  the  terminal
  874.                                        input where it may receive
  875.                                        special  processing by the
  876.                                        terminal handler.
  877.        ssttuuffff--rreesseett                     Acts  like   ssttuuffff,   then
  878.                                        aborts  input  the same as
  879.                                        an interrupt.
  880.        ttrraannssppoossee--cchhaarrss  ^^TT             Exchanges the two  charac-
  881.                                        ters on either side of the
  882.                                        cursor, or the two  previ-
  883.                                        ous characters if the cur-
  884.                                        sor is at end of line.
  885.        uupp--hhiissttoorryy  ^^PP                  Scrolls the history buffer
  886.                                        backward  one  line  (ear-
  887.                                        lier).
  888.        yyaannkk  ^^YY                        Inserts the most  recently
  889.                                        killed  text string at the
  890.                                        current cursor position.
  891.        yyaannkk--ppoopp  ^^[[yy                   Immediately after a  yyaannkk,
  892.                                        replaces the inserted text
  893.                                        string with the next  pre-
  894.                                        vious  killed text string.
  895.  
  896. FFIILLEESS
  897.        ~/.profile
  898.        /etc/profile
  899.  
  900. SSEEEE AALLSSOO
  901.        Sh(1) on System V or Sun OS.
  902.  
  903.        _U_N_I_X _S_h_e_l_l _P_r_o_g_r_a_m_m_i_n_g_,  Stephan  G.  Kochan,  Patrick  H.
  904.        Wood, Hayden.
  905.  
  906.        _K_o_r_n_S_h_e_l_l_:  _C_o_m_m_a_n_d _a_n_d _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e _(_n_o_t _y_e_t _p_u_b_-
  907.        _l_i_s_h_e_d_)_, Morris Bolsky and David Korn.
  908.  
  909. AAUUTTHHOORRSS
  910.        Based on the public domain 7th edition Bourne shell.
  911.  
  912.        System V and Korn modifications by Eric Gisin,  with  con-
  913.        tributions by Ron Natalie, Arnold Robbins, Doug Gwyn, Erik
  914.        Baalbergen, AT&T (getopt(3)), John McMillan and Simon Ger-
  915.        raty.
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                             April 1992                         14
  923.  
  924.  
  925.  
  926.  
  927.  
  928. KSH(1)                                                     KSH(1)
  929.  
  930.  
  931. DDIIFFFFEERREENNCCEESS FFRROOMM AATT&&TT VVEERRSSIIOONN
  932.        The  sseelleecctt statement is not implemented.  Variable arrays
  933.        are not implemented.  Variable attributes other than inte-
  934.        ger  are  not implemented.  The EERRRR and EEXXIITT traps are not
  935.        implemented for functions.  Alias expansion  is  inhibited
  936.        at  the  beginning of an alias definition in the AT&T ver-
  937.        sion.  Korn evaluates expressions differently [elaborate].
  938.  
  939. BBUUGGSS
  940.        Interactive shells may occasionally hang while waiting for
  941.        a job in the BSD version.
  942.  
  943.        The 8th bit is stripped in emacs mode.
  944.  
  945.        Quoting double-quote (") characters inside back-quote  (`)
  946.        inside  double-quotes  does  not behave properly.  Why are
  947.        you doing this?
  948.  
  949.        The emacs mode can ``lose'' stty command done by the user.
  950.  
  951.        Unsetting  special variables may cause unexpected results.
  952.  
  953.        Functions declared  as  having  local  scope  really  have
  954.        global scope.
  955.  
  956.        Here documents inside functions do not work correctly.
  957.  
  958.        Exit  on  error  (sseett  --ee or sseett --oo eerrrreexxiitt) does not work
  959.        correctly.
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                             April 1992                         15
  989.  
  990.  
  991.  
  992.  
  993.  
  994. TEST(1)                                                   TEST(1)
  995.  
  996.  
  997. NNAAMMEE
  998.        test - test condition (Korn and 8th edition)
  999.  
  1000. SSYYNNOOPPSSIISS
  1001.        tteesstt _e_x_p_r_e_s_s_i_o_n
  1002.        [[ _e_x_p_r_e_s_s_i_o_n ]]
  1003.  
  1004. DDEESSCCRRIIPPTTIIOONN
  1005.        TTeesstteevvaalluuttaatteess tthhee _e_x_p_r_e_s_s_i_o_n aanndd rreettuurrnnss zzeerroo  ssttaattuuss  iiff
  1006.        ttrruuee,,  aanndd nnoonn--zzeerroo ssttaattuuss ootthheerrwwiissee..  IItt iiss nnoorrmmaallllyy uusseedd
  1007.        aass tthhee ccoonnttrroolllliinngg ccoommmmaanndd ooff tthhee iiff aanndd wwhhiillee ssttaatteemmeennttss..
  1008.  
  1009.        The following basic expressions are available.
  1010.  
  1011.               -r  file                       file  exists  and is
  1012.               readable
  1013.               -w file                       file  exists  and  is
  1014.               writable
  1015.               -x  file                       file  exists  and is
  1016.               executable
  1017.               -f  file                       file  is  a  regular
  1018.               file
  1019.               -d file                       file is a directory
  1020.               -c  file                       file  is a character
  1021.               special device
  1022.               -b file                       file is a block  spe-
  1023.               cial device
  1024.               -p file                       file is a named pipe
  1025.               -u  file                       file mode has setuid
  1026.               bit
  1027.               -g file                       file mode has  setgid
  1028.               bit
  1029.               -k  file                       file mode has sticky
  1030.               bit
  1031.               -s file                       file is not empty
  1032.               -L file                       file  is  a  symbolic
  1033.               link
  1034.               -S file                       file is a socket
  1035.               file  -nt  file                 first file is newer
  1036.               than second file
  1037.               file -ot file                 first file  is  older
  1038.               than second file
  1039.               file  -ef  file                 first  file  is the
  1040.               same file as second file
  1041.               -t filedes                    file descriptor is  a
  1042.               tty device
  1043.  
  1044.               string                        string is not null
  1045.               -z string                     string is null
  1046.               -n string                     string is not null
  1047.               string = string               strings are equal
  1048.               string != string              strings are not equal
  1049.  
  1050.               number -eq number             numbers compare equal
  1051.  
  1052.  
  1053.  
  1054. Korn shell                 January 1988                         1
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. TEST(1)                                                   TEST(1)
  1061.  
  1062.  
  1063.               number  -ne  number             numbers compare not
  1064.               equal
  1065.               number   -ge   number             numbers   compare
  1066.               greater than or equal
  1067.               number   -gt   number             numbers   compare
  1068.               greater than
  1069.               number -le number             numbers compare  less
  1070.               than or equal
  1071.               number  -lt number             numbers compare less
  1072.               than
  1073.  
  1074.        The above basic expressions may be combined with the  fol-
  1075.        lowing operators.
  1076.  
  1077.               expr -o expr                  logical or
  1078.               expr -a expr                  logical and
  1079.               ! expr                        logical not
  1080.               ( expr )                      grouping
  1081.  
  1082. AAUUTTHHOORR
  1083.        Erik Baalbergen. Modified by Arnold Robbins.
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120. Korn shell                 January 1988                         2
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. GETOPTS(1)                                             GETOPTS(1)
  1127.  
  1128.  
  1129. NNAAMMEE
  1130.        getopts - parse command options
  1131.  
  1132. SSYYNNOOPPSSIISS
  1133.        ggeettooppttss optstring name [arg ...]
  1134.  
  1135. DDEESSCCRRIIPPTTIIOONN
  1136.        _g_e_t_o_p_t_s  is  used  by shell procedures to parse positional
  1137.        parameters and to check for legal  options.   It  supports
  1138.        all  applicable  rules of the command syntax standard (see
  1139.        Rules 3-10, _i_n_t_r_o(1)).  It should be used in place of  the
  1140.        _g_e_t_o_p_t(1) command.  (See the WWAARRNNIINNGG, below.)
  1141.  
  1142.        _o_p_t_s_t_r_i_n_g  must  contain  the  option  letters the command
  1143.        using _g_e_t_o_p_t_s will recognize; if a letter is followed by a
  1144.        colon,  the  option  is expected to have an argument which
  1145.        should be separated from it by white space.
  1146.  
  1147.        Each time it is  invoked,  _g_e_t_o_p_t_s  will  place  the  next
  1148.        option  in  the  shell  variable _n_a_m_e and the index of the
  1149.        next argument  to  be  processed  in  the  shell  variable
  1150.        OOPPTTIINNDD.   Whenever  the  shell  or  a  shell  procedure is
  1151.        invoked, OOPPTTIINNDD is initialized to 11.
  1152.  
  1153.        When an option requires an option-argument, _g_e_t_o_p_t_s places
  1154.        it in the shell variable OOPPTTAARRGG.
  1155.  
  1156.        If  an  illegal option is encountered, ?? will be placed in
  1157.        _n_a_m_e.
  1158.  
  1159.        When the end of the options is encountered, _g_e_t_o_p_t_s  exits
  1160.        with  a  non-zero  exit status.  The special option ``----''
  1161.        may be used to delimit the end of the options.
  1162.  
  1163.        By default, _g_e_t_o_p_t_s parses the positional parameters.   If
  1164.        extra arguments (_a_r_g ...) are given on the _g_e_t_o_p_t_s command
  1165.        line, _g_e_t_o_p_t_s will parse them instead.
  1166.  
  1167.        So all new commands will  adhere  to  the  command  syntax
  1168.        standard described in _i_n_t_r_o(1), they should use _g_e_t_o_p_t_s(1)
  1169.        or _g_e_t_o_p_t(3C) to parse positional parameters and check for
  1170.        options  that  are  legal  for that command (see WWAARRNNIINNGGSS,
  1171.        below).
  1172.  
  1173. EEXXAAMMPPLLEE
  1174.        The following fragment of a shell program  shows  how  one
  1175.        might  process  the  arguments for a command that can take
  1176.        the options aa or  bb,  as  well  as  the  option  oo,  which
  1177.        requires an option-argument:
  1178.  
  1179.               wwhhiillee ggeettooppttss aabboo:: cc
  1180.               ddoo
  1181.                    ccaassee $$cc iinn
  1182.                    aa||bb))      FFLLAAGGSS==$$FFLLAAGGSS$$cc;;;;
  1183.  
  1184.  
  1185.  
  1186. Korn shell                 January 1988                         1
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. GETOPTS(1)                                             GETOPTS(1)
  1193.  
  1194.  
  1195.                    oo))        OOAARRGG==$$OOPPTTAARRGG;;;;
  1196.                    \\??))       eecchhoo $$UUSSAAGGEE 11>>&&22
  1197.                              eexxiitt 22;;;;
  1198.                    eessaacc
  1199.               ddoonnee
  1200.               sshhiifftt OOPPTTIINNDD--11
  1201.  
  1202.        This code will accept any of the following as equivalent:
  1203.  
  1204.               ccmmdd --aa --bb --oo ""xxxxxx zz yyyy"" ffiillee
  1205.               ccmmdd --aa --bb --oo ""xxxxxx zz yyyy"" ---- ffiillee
  1206.               ccmmdd --aabb --oo ""xxxxxx zz yyyy"" ffiillee
  1207.               ccmmdd --aabb --oo ""xxxxxx zz yyyy"" ---- ffiillee
  1208.  
  1209. SSEEEE AALLSSOO
  1210.        intro(1), sh(1).
  1211.        getopt(3C) in the _P_r_o_g_r_a_m_m_e_r_'_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  1212.        _U_N_I_X _S_y_s_t_e_m _V _R_e_l_e_a_s_e _3_._0 _R_e_l_e_a_s_e _N_o_t_e_s.
  1213.  
  1214. WWAARRNNIINNGG
  1215.        Although  the following command syntax rule (see _i_n_t_r_o(1))
  1216.        relaxations are permitted under  the  current  implementa-
  1217.        tion, they should not be used because they may not be sup-
  1218.        ported in future releases of the system.  As in the  EEXXAAMM--
  1219.        PPLLEE  section  above, aa and bb are options, and the option oo
  1220.        requires an option-argument:
  1221.  
  1222.               ccmmdd --aabbooxxxxxx ffiillee         (Rule 5 violation: options with
  1223.                         option-arguments must not be grouped with other options)
  1224.               ccmmdd --aabb --ooxxxxxx ffiillee       (Rule 6 violation: there must be
  1225.                         white space after an option that takes an option-argument)
  1226.  
  1227.        Changing the value of the shell variable OOPPTTIINNDD or parsing
  1228.        different   sets  of  arguments  may  lead  to  unexpected
  1229.        results.
  1230.  
  1231. DDIIAAGGNNOOSSTTIICCSS
  1232.        _g_e_t_o_p_t_s prints an error message on the standard error out-
  1233.        put  when  it  encounters an option letter not included in
  1234.        _o_p_t_s_t_r_i_n_g.
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252. Korn shell                 January 1988                         2
  1253.  
  1254.  
  1255.