home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk381.lzh / SKsh / Reference.doc < prev    next >
Text File  |  1990-10-20  |  153KB  |  7,657 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                                   Reference Manual 
  18.  
  19.                                          SKsh
  20.  
  21.                             A ksh-like Shell for the Amiga
  22.  
  23.                                      Version 1.6
  24.  
  25.  
  26.                                 (Copyright) 1989, 1990
  27.  
  28.                                      Steve Koren
  29.  
  30.                                    October 4, 1990
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           Table of Contents
  74.  
  75.  
  76.                Introduction......................................4
  77.                !, !!.............................................5
  78.                _ANSI.............................................6
  79.                _DIR_.............................................7
  80.                _FILE_............................................7
  81.                _EXEC_............................................7
  82.                alias.............................................9
  83.                aliases...........................................10
  84.                AREXX_PORT........................................11
  85.                argcount..........................................12
  86.                SKSHINIT..........................................13
  87.                sksh..............................................14
  88.                basename..........................................15
  89.                break.............................................16
  90.                builtins..........................................17
  91.                case/esac.........................................18
  92.                cat...............................................19
  93.                cd................................................20
  94.                chmod.............................................21
  95.                cilist............................................22
  96.                clear, cls........................................24
  97.                CLINUM............................................25
  98.                CMDNUM............................................26
  99.                COLUMNS...........................................27
  100.                complist..........................................28
  101.                continue..........................................30
  102.                ctpri.............................................31
  103.                date..............................................32
  104.                dec...............................................33
  105.                dir...............................................34
  106.                dirname...........................................35
  107.                dwclist...........................................36
  108.                echo..............................................38
  109.                eval..............................................39
  110.                exit..............................................40
  111.                export............................................41
  112.                false.............................................44
  113.                for/do/done.......................................45
  114.                force.............................................46
  115.                function..........................................47
  116.                functions.........................................48
  117.                getenv............................................49
  118.                history...........................................50
  119.                HISTSIZE..........................................51
  120.                HOME..............................................52
  121.                IFS...............................................54
  122.                inc...............................................55
  123.                info..............................................56
  124.                INTERACTIVE.......................................57
  125.                LINES.............................................60
  126.                ll................................................61
  127.  
  128.  
  129.           SKsh Amiga Shell             Page 2             Reference Manual
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                LLMIN.............................................62
  140.                local.............................................63
  141.                LOGOUT............................................64
  142.                ls................................................65
  143.                match.............................................67
  144.                MAXDIST...........................................68
  145.                mem...............................................69
  146.                mkdir.............................................70
  147.                mv................................................71
  148.                OLDPWD............................................72
  149.                options...........................................73
  150.                PATH..............................................76
  151.                path..............................................77
  152.                PNPC..............................................78
  153.                preparse..........................................79
  154.                printf............................................80
  155.                ps................................................81
  156.                PS1...............................................82
  157.                PS2...............................................83
  158.                PWD...............................................84
  159.                pwd...............................................85
  160.                quit..............................................86
  161.                read..............................................87
  162.                resident..........................................88
  163.                return............................................89
  164.                rm................................................90
  165.                rmdir.............................................91
  166.                ROOT..............................................92
  167.                set...............................................93
  168.                setmap............................................94
  169.                SHELL.............................................97
  170.                shift.............................................98
  171.                SIZE..............................................99
  172.                sleep.............................................100
  173.                source............................................101
  174.                stack.............................................102
  175.                SYSNAME...........................................103
  176.                time..............................................104
  177.                touch.............................................105
  178.                true..............................................106
  179.                unalias...........................................107
  180.                unfunc............................................108
  181.                unset.............................................109
  182.                variables.........................................110
  183.                version...........................................111
  184.                whence............................................112
  185.                which.............................................113
  186.                while/do/done.....................................114
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.           SKsh Amiga Shell             Page 3             Reference Manual
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           Introduction
  206.  
  207.             This  reference manual describes each SKsh command, variable,
  208.             alias,  or  function in a concise manner.  Each page contains
  209.             the following information:
  210.  
  211.             Name:     The name of the command, alias, etc.
  212.  
  213.             Type:     Variable, Alias, Function, Builtin, or Keyword.
  214.  
  215.             Default:  The default value for variables, or definition  for
  216.                       aliases.
  217.  
  218.             Usage:    Command syntax
  219.  
  220.             Range:    Legal values for variables or parameters
  221.  
  222.             About:    Text describing the command, variable, etc.
  223.  
  224.             Example:  A brief example usage.
  225.  
  226.             See Also: Other related commands, variables, etc.
  227.  
  228.             When  reading the command syntax, anything in square brackets
  229.             is  optional.    Anything  followed by three dots can be  re-
  230.             peated any  number of times.  A vertical bar is used to sepa-
  231.             rate  option where one or the other, but  not  both,  can  be
  232.             used.
  233.  
  234.             In  general,  options to  commands are preceded by a dash ('-
  235.             ').  The dash  character passed alone tells a command to stop
  236.             reading  options.   This  can  be  useful to pass a dash as a
  237.             parameter.  For example,
  238.  
  239.                     echo - -
  240.  
  241.             would print a single dash.  Also,  'command -a -b' is equiva-
  242.             lent to 'command -ab'.
  243.  
  244.             In  version 1.4 and later of SKsh, the  documentation for ex-
  245.             ternal  binary  commands has been moved  to  the  ExtCmds.doc
  246.             file.
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.           SKsh Amiga Shell             Page 4             Reference Manual
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           _________________________________________________________________
  272.  
  273.             Name:     !, !!
  274.  
  275.             Type:     Alias
  276.  
  277.             Default:  history -e
  278.                       history -e -1
  279.  
  280.             Usage:    ! [ pattern | abs_num | rel_num ]
  281.                       !!
  282.  
  283.             Range:    n/a
  284.  
  285.             About:    These  two  aliases  provide an easy way to use the
  286.                       history  -e  command.  !! will execute the previous
  287.                       command from the  history list by executing history
  288.                       -e  -1.    ! will  execute a specified command from
  289.                       the  history list.  This command can either specify
  290.                       an  absolute  number,  a  relative  offset from the
  291.                       most  recent  command  (the  offset should be nega-
  292.                       tive), or a  partial line or pattern to search for.
  293.                       If  a  search  pattern is given, it should  be  en-
  294.                       closed in quotes so  that  SKsh  does  not  attempt
  295.                       file name generation on the wildcard pattern.
  296.  
  297.             Example:  ! cc
  298.  
  299.             See Also: history
  300.  
  301.           _________________________________________________________________
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.           SKsh Amiga Shell             Page 5             Reference Manual
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           _________________________________________________________________
  338.  
  339.             Name:     _ANSI_BS
  340.                       _ANSI_BE
  341.                       _ANSI_IS
  342.                       _ANSI_IE
  343.                       _ANSI_US
  344.                       _ANSI_UE
  345.                       _ANSI_P1
  346.                       _ANSI_P2
  347.                       _ANSI_P3
  348.                       _ANSI_CLEAR
  349.  
  350.             Type:     Variable
  351.  
  352.             Default:  "^[[1m"                (bold-start)
  353.                       "^[[m"                 (bold-end)
  354.                       "^[[3m"                (italic-start)
  355.                       "^[[m"                 (italic-end)
  356.                       "^[[4m"                (underline-start)
  357.                       "^[[m"                 (underline-end)
  358.                       "^[[0;31;40m"          (pen-1)
  359.                       "^[[0;32;40m"          (pen-2)
  360.                       "^[[0;33;40m"          (pen-3)
  361.                       "^[[H^[[2J"            (clear screen)
  362.  
  363.             Usage:    $_ANSI_??
  364.  
  365.             Range:    n/a
  366.  
  367.             About:    These  variables are set by SKsh to valid ANSI  es-
  368.                       cape  sequences  which  control the  Amiga  console
  369.                       device.  They can be  used  in  echo  statements or
  370.                       prompts.
  371.  
  372.                       Since  these  variables,  when  output,  affect the
  373.                       console  device, they are not normally displayed by
  374.                       the set command.
  375.  
  376.             Example:  echo $_ANSI_CLEAR      # clear the screen
  377.  
  378.             See Also: echo
  379.  
  380.           _________________________________________________________________
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.           SKsh Amiga Shell             Page 6             Reference Manual
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           _________________________________________________________________
  404.  
  405.             Name:     _DIR_S
  406.                       _DIR_E
  407.                       _DIR_L
  408.                       _FILE_S
  409.                       _FILE_E
  410.                       _DIR_L
  411.                       _EXEC_S
  412.                       _EXEC_E
  413.                       _EXEC_L
  414.  
  415.             Type:     Variable
  416.  
  417.             Default:  "$_ANSI_P3"            (dir-start)
  418.                       "$_ANSI_P1"            (dir-end)
  419.                       0                      (dir-length)
  420.                       NULL                   (file-start)
  421.                       NULL                   (file-end)
  422.                       0                      (file-length)
  423.                       NULL                   (exec-start)
  424.                       NULL                   (exec-end)
  425.                       0                      (exec-length)
  426.  
  427.             Usage:
  428.  
  429.             Range:    n/a
  430.  
  431.             About:    These  variables  control the display format of the
  432.                       'ls'  command when the '-F' option is set (as it is
  433.                       by  default when the  'dir'  or  'll'  commands are
  434.                       used).   Before printing each file name (whether in
  435.                       a short or long  format listing), SKsh will examine
  436.                       the file type.  If the it is a  directory, the con-
  437.                       tents of the _DIR_S  variable is printed.  If it is
  438.                       a  file,  the  contents of _FILE_S is printed.   If
  439.                       the 'e' bit is set, _EXEC_S is  printed.   (Because
  440.                       of this, it  is  possible to print more than one of
  441.                       the above  variables if the name is both a file and
  442.                       has its 'e' bit set).
  443.  
  444.                       In a  similar manner, the contents of the appropri-
  445.                       ate  _FILE_E,  _DIR_E,  and  _EXEC_E  variables  is
  446.                       printed  after the file name.  This allows the for-
  447.                       mat of the directory listing to be customized.
  448.  
  449.                       These  variables are only  output when the '-F' op-
  450.                       tion  is  used.   Also,  their  contents is printed
  451.                       verbatim; it is not  expanded as with 'PS1'.  Thus,
  452.                       any  variables should be  expanded when these vari-
  453.                       ables are set, as in the example below.
  454.  
  455.                       The _DIR_L, _EXEC_L,  and  _FILE_L  variables store
  456.                       integers  which   should   represent  the  printing
  457.  
  458.  
  459.           SKsh Amiga Shell             Page 7             Reference Manual
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.                       length of the _DIR_S, _DIR_E, etc variables.   This
  470.                       lets  the  ls  command correctly judge the width of
  471.                       the  display.   The  _L  variables should store the
  472.                       combined  printing length of both  the  _S  and  _E
  473.                       variables.   For  example, if _DIR_S has a printing
  474.                       length of 1 and _DIR_E has a  printing length of 2,
  475.                       _DIR_L would be set to 3.
  476.  
  477.             Example:  _FILE_S="$_ANSI_US"   # underline file names
  478.                       _FILE_E="$_ANSI_UE"
  479.  
  480.                       _DIR_S=''     # print highlighed / after dirs
  481.                       _DIR_E="$_ANSI_P3/$_ANSI_P1"
  482.                       _DIR_L=1
  483.  
  484.             See Also: ls, dir, ll
  485.  
  486.           _________________________________________________________________
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.           SKsh Amiga Shell             Page 8             Reference Manual
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           _________________________________________________________________
  536.  
  537.             Name:     alias
  538.  
  539.             Type:     Builtin
  540.  
  541.             Default:  n/a
  542.  
  543.             Usage:    alias [ pattern | string [ '=' ] string ]
  544.  
  545.             Range:    n/a
  546.  
  547.             About:    The alias  builtin command (not to be confused with
  548.                       'aliases',  which  is  itself an  alias) is used to
  549.                       set and list aliases.  If given  no  parameters, it
  550.                       simply acts as a 'set -a' command.   If  given  one
  551.                       parameter, which is  a  pattern, all aliases match-
  552.                       ing that  pattern are printed.  If given two param-
  553.                       eters (or  there  where  the  second is a '='), the
  554.                       first  string  becomes an  alias  with  the  second
  555.                       string as its definition.
  556.  
  557.                       Aliases  are  expanded when used as a command.  Any
  558.                       arguments  are  appended to the text of the aliases
  559.                       and the resulting string is executed.
  560.  
  561.                       Unlike  ksh and sh, there can be spaces surrounding
  562.                       the '=' sign, which is itself optional.
  563.  
  564.             Example:  alias foo='echo "This is the foo alias"'
  565.  
  566.             See Also: set, alias, unalias
  567.  
  568.           _________________________________________________________________
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.           SKsh Amiga Shell             Page 9             Reference Manual
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.           _________________________________________________________________
  602.  
  603.             Name:     aliases
  604.  
  605.             Type:     Alias
  606.  
  607.             Default:  set -a
  608.  
  609.             Usage:    aliases [-s] [pattern]
  610.  
  611.             Range:    n/a
  612.  
  613.             About:    This  alias  lists  defined aliases.   The  pattern
  614.                       uses  normal wildcards, but must be quoted to avoid
  615.                       being   interpreted  by  the   filename   expansion
  616.                       mechanism.  If the  pattern is omitted, all aliases
  617.                       in the  current context are listed except those be-
  618.                       ginning with an underscore (hidden aliases).
  619.  
  620.                       Only aliases  for  the  current context are listed,
  621.                       so this  command may have a different effect inside
  622.                       of   a   subshell  or   function  than  when  typed
  623.                       manually.
  624.  
  625.             Example:  aliases -s '[a-h]*'
  626.  
  627.             See Also: set, alias
  628.  
  629.           _________________________________________________________________
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.           SKsh Amiga Shell            Page 10             Reference Manual
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.             _________________________________________________________________
  668.  
  669.             Name:     AREXX_PORT
  670.  
  671.             Type:     Variable
  672.  
  673.             Default:  SKSH or SKSH_$CLINUM
  674.                       unset if no ARexx port available
  675.  
  676.             Usage:    $AREXX_PORT
  677.  
  678.             Range:    n/a
  679.  
  680.             About:    This variable contains the name of the  ARexx  port
  681.                       opened by SKsh open invocation.  The variable  will
  682.                       be unset  if  SKsh  did  not  open  an  ARexx  port
  683.                       (either because it was told not  to,  or  it  could
  684.                       not because ARexx was not installed).
  685.  
  686.             Example:  if [ -z "$AREXX_PORT" ]
  687.                       then
  688.                          echo "This SKsh does not have an ARexx port"
  689.                       else
  690.                          echo "The ARexx port name is $AREXX_PORT"
  691.                       fi
  692.  
  693.             See Also: sksh
  694.                       UserMan.doc:
  695.                       Advanced Topics: Using SKsh with ARexx
  696.  
  697.           _________________________________________________________________
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.           SKsh Amiga Shell            Page 11             Reference Manual
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.           _________________________________________________________________
  734.  
  735.             Name:     argcount
  736.  
  737.             Type:     Builtin
  738.  
  739.             Default:  n/a
  740.  
  741.             Usage:    argcount [ parameter ... ]
  742.  
  743.             Range:    n/a
  744.  
  745.             About:    argcount simply prints a count of its arguments.
  746.  
  747.             Example:  argcount should 'print two'
  748.  
  749.             See Also:
  750.  
  751.           _________________________________________________________________
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.           SKsh Amiga Shell            Page 12             Reference Manual
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.           _________________________________________________________________
  800.  
  801.             Name:     SKSHINIT
  802.  
  803.             Type:     Variable
  804.  
  805.             Default:  "sksh:.skshrc"
  806.  
  807.             Usage:    $SKSHINIT
  808.  
  809.             Range:    n/a
  810.  
  811.             About:    This  variable is set in the .skshinit file to  the
  812.                       name  of  a  user  modifiable  configuration  file.
  813.                       Normally this is "s:.skshrc".  The user  configura-
  814.                       tion file is sourced  (not  executed!) for interac-
  815.                       tive SKsh sessions.
  816.  
  817.                       The   s:.skshrc   file   is   provided   for   user
  818.                       modification.        Users   should   not    modify
  819.                       s:.skshinit.  If you wish to change  something that
  820.                       is  defined in  s:.skshinit,  simply redefine it in
  821.                       s:.skshrc.     s:.skshrc    is    sourced     after
  822.                       s:.skshinit.
  823.  
  824.                       Your  s:.skshrc  file  may  optionally source other
  825.                       files.
  826.  
  827.                       In SKsh 1.5 and later, the preparsed form  of  this
  828.                       file will  be  executed if it exists instead of the
  829.                       ascii form.
  830.  
  831.             Example:
  832.  
  833.             See Also: sksh, source, preparse
  834.  
  835.           _________________________________________________________________
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.           SKsh Amiga Shell            Page 13             Reference Manual
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.           _________________________________________________________________
  866.  
  867.             Name:     sksh
  868.  
  869.             Type:     External Command
  870.  
  871.             Default:  n/a
  872.  
  873.             Usage:    sksh [ -a | -p portname ] [ -c string | fspec... ]
  874.  
  875.             Range:    n/a
  876.  
  877.             About:    This is, of course, the main SKsh binary.   If  in-
  878.                       voked with no  parameters, an interactive SKsh ses-
  879.                       sion is started.   If  invoked with the '-c' option
  880.                       followed by a string,  the  string  is  executed by
  881.                       SKsh as if it had been typed, and  SKsh  exits when
  882.                       the  operation is complete.  If the string contains
  883.                       spaces, it must  be  surrounded by quotes (although
  884.                       this  depends  on  the  invoking shell or  environ-
  885.                       ment).   If   invoked with filespec arguments, each
  886.                       file in turn is  executed (not sourced).  SKsh then
  887.                       exits when finished executing all the files.
  888.  
  889.                       If  SKsh  is  invoked  non-interactively,  it  will
  890.                       still read the .skshinit file, but not the  .skshrc
  891.                       file.   This   allows you to have output statements
  892.                       in the .skshrc file  without having this output ap-
  893.                       pear when non-interacrive scripts are run.  If  you
  894.                       really want to run the .skshrc file first, use:
  895.  
  896.                          sksh s:.skshrc my_file.sksh
  897.  
  898.                       If SKsh is given the "-a" flag upon  invocation, it
  899.                       attempts to open an ARexx port if ARexx  is  indeed
  900.                       installed on the system.  The  default port name is
  901.                       "SKSH" (all caps).  If this port is taken  (perhaps
  902.                       by  another  invocation of SKsh),  SKsh  appends an
  903.                       underscore and the cli  number of this process (for
  904.                       example, "SKSH_5"), and tries again.  If  it  still
  905.                       cannot open the port, it gives up.
  906.  
  907.                       If the "-p" flag is given  followed by a port name,
  908.                       SKsh  will  attempts to use the  following argument
  909.                       as a portname when opening ARexx.
  910.  
  911.             Example:  sksh -c "expr 21 * 2"
  912.  
  913.             See Also: source, AREXX_PORT
  914.  
  915.           _________________________________________________________________
  916.  
  917.  
  918.  
  919.  
  920.  
  921.           SKsh Amiga Shell            Page 14             Reference Manual
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.           _________________________________________________________________
  932.  
  933.             Name:     basename
  934.  
  935.             Type:     Builtin
  936.  
  937.             Default:  n/a
  938.  
  939.             Usage:    basename [ fspec ... ]
  940.  
  941.             Range:    n/a
  942.  
  943.             About:    basename prints the "base" name of  a  given  path.
  944.                       For  example, the basename of  sys:System/Format is
  945.                       simply Format.  Note that the  basename  may  be  a
  946.                       directory  and  not  a  file;   for   example,  the
  947.                       basename of sys:usr/bin is bin, even though bin  is
  948.                       a directory.   If  basename is passed more than one
  949.                       parameter, it prints the basename  of  each  param-
  950.                       eter in turn.
  951.  
  952.             Example:  basename sys:usr/bin/wc
  953.  
  954.             See Also: dirname, extname
  955.  
  956.           _________________________________________________________________
  957.  
  958.  
  959.  
  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.           SKsh Amiga Shell            Page 15             Reference Manual
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.           _________________________________________________________________
  998.  
  999.             Name:     break
  1000.  
  1001.             Type:     Builtin
  1002.  
  1003.             Default:  n/a
  1004.  
  1005.             Usage:    break [ num ]
  1006.  
  1007.             Range:    n/a
  1008.  
  1009.             About:    break  exits  gracefully from  an  enclosing for or
  1010.                       while  loop.   If  a  numeric argument is given, it
  1011.                       breaks from  that  many  enclosing levels of for or
  1012.                       while.
  1013.  
  1014.             Example:  for a in a b c d e f
  1015.                       do
  1016.                          echo $a
  1017.                          if [ "$a" = "c" ] then break; fi
  1018.                       done
  1019.  
  1020.             See Also: continue
  1021.  
  1022.           _________________________________________________________________
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.           SKsh Amiga Shell            Page 16             Reference Manual
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.           _________________________________________________________________
  1064.  
  1065.             Name:     builtins
  1066.  
  1067.             Type:     Alias
  1068.  
  1069.             Default:  set -b
  1070.  
  1071.             Usage:    builtins [ -s ] [ pattern ]
  1072.  
  1073.             Range:    n/a
  1074.  
  1075.             About:    This  aliases  lists  SKsh  builtin commands.   The
  1076.                       pattern  uses  normal wildcards, but must be quoted
  1077.                       to  avoid  being interpreted by the filename expan-
  1078.                       sion  mechanism.   If  the  pattern is omitted, all
  1079.                       builtins are listed  except those beginning with an
  1080.                       underscore  character (hidden builtins).  There are
  1081.                       currently no hidden builtins.
  1082.  
  1083.             Example:  builtins -s '[a-h]*'
  1084.  
  1085.             See Also: set
  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.           SKsh Amiga Shell            Page 17             Reference Manual
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.           _________________________________________________________________
  1130.  
  1131.             Name:     case/esac
  1132.  
  1133.             Type:     Keywords
  1134.  
  1135.             Default:  n/a
  1136.  
  1137.             Usage:    case param in { pattern ) stmt_list ;; } ... esac
  1138.  
  1139.             Range:    n/a
  1140.  
  1141.             About:    If  the  supplied  parameter  matches  any  of  the
  1142.                       (wildcard)  patterns, then  the  statement list for
  1143.                       that  pattern is executed.  A close-paren (  ")"  )
  1144.                       must  follow  the  wildcard  pattern, and a  double
  1145.                       semicolon  must  terminate the statement list.  The
  1146.                       case  statement  must  be  terminated by a matching
  1147.                       esac keyword.
  1148.  
  1149.             Example:  case "$foo" in
  1150.                         bar)  echo "Matched bar";
  1151.                               echo "testing..." ;;
  1152.                         n*t)  echo "Matched n*t";;
  1153.                         a??c) echo "Matched a??c";;
  1154.                       esac
  1155.  
  1156.             See Also:
  1157.  
  1158.           _________________________________________________________________
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.           SKsh Amiga Shell            Page 18             Reference Manual
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.           _________________________________________________________________
  1196.  
  1197.             Name:     cat
  1198.  
  1199.             Type:     Builtin
  1200.  
  1201.             Default:  n/a
  1202.  
  1203.             Usage:    cat [ fspec ... ]
  1204.  
  1205.             Range:    n/a
  1206.  
  1207.             About:    cat prints  the  contents of each file passed to it
  1208.                       on  the  command line, or the  standard input if no
  1209.                       files are  passed.   The  contents of each file are
  1210.                       concatenated,  and  are  not   separated  by  blank
  1211.                       lines.
  1212.  
  1213.                       In SKsh 1.5 and later, there are two forms  of  the
  1214.                       cat  command,  a  builtin and  an  external binary.
  1215.                       The   external   binary   is   described   in   the
  1216.                       ExtCmds.doc file.  It can be made the  default; see
  1217.                       the documentation there for details.
  1218.  
  1219.                       In SKsh, the  builtin  cat cannot be used to trans-
  1220.                       fer  binary files, only ASCII data.  Also, the  se-
  1221.                       quence:
  1222.  
  1223.                          cat my_file.txt > my_file1.txt
  1224.  
  1225.                       can be  faster  accomplished with the cp command or
  1226.                       the external cat command.
  1227.  
  1228.             Example:  cat my_file.txt
  1229.  
  1230.             See Also: cp
  1231.                       The cat entry in the ExtCmds.doc file
  1232.  
  1233.           _________________________________________________________________
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.           SKsh Amiga Shell            Page 19             Reference Manual
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.           _________________________________________________________________
  1262.  
  1263.             Name:     cd
  1264.  
  1265.             Type:     Builtin
  1266.  
  1267.             Default:  n/a
  1268.  
  1269.             Usage:    cd [ -p | dirname ]
  1270.  
  1271.             Range:    n/a
  1272.  
  1273.             About:    cd  changes   the   current  working  directory  to
  1274.                       dirname,  or  to  the  previous directory (the con-
  1275.                       tents  of  the  OLDPWD  variable) if the -p flag is
  1276.                       set.  If no  parameters are passed, cd moves to the
  1277.                       directory  indicated by the HOME variable.  This is
  1278.                       convenient when you are  doing most of your work in
  1279.                       one place, and wish to  return there easily.  Under
  1280.                       AmigaDos,  the  HOME  variable can be changed  very
  1281.                       easily with:
  1282.  
  1283.                          HOME=.
  1284.  
  1285.                       That is, you do not have  to  worry  about  certain
  1286.                       files  being in the  HOME  directory as you do in a
  1287.                       multi-user operating system such as UNIX.
  1288.  
  1289.             Example:  cd -p        # go back to old directory
  1290.  
  1291.             See Also: PWD, pwd, OLDDIR
  1292.  
  1293.           _________________________________________________________________
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.           SKsh Amiga Shell            Page 20             Reference Manual
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.           _________________________________________________________________
  1328.  
  1329.             Name:     chmod
  1330.  
  1331.             Type:     Builtin
  1332.  
  1333.             Default:  n/a
  1334.  
  1335.             Usage:    chmod flags | +flags | -flags   [ file ... ]
  1336.  
  1337.             Range:    flags : "hsparewd"
  1338.  
  1339.             About:    chmod  changes  the  file  protection bits  on  the
  1340.                       named files.  Flags can be one or more of the  fol-
  1341.                       lowing  letters:  "hsparewd".  If the flags  param-
  1342.                       eter is given  directly with no leading '+' or '-',
  1343.                       the  permissions for all the named files are set to
  1344.                       that  value.   A   leading '+' causes the indicated
  1345.                       permissions bits  to  be  set  without changing the
  1346.                       others, and a  leading '-' causes them to be reset.
  1347.                       In  addition, a 'x' may be used in place of the 'e'
  1348.                       flag.
  1349.  
  1350.             Example:  chmod -a *.c   # reset archive bit on all .c files
  1351.  
  1352.             See Also: ls
  1353.  
  1354.           _________________________________________________________________
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.           SKsh Amiga Shell            Page 21             Reference Manual
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.           _________________________________________________________________
  1394.  
  1395.             Name:     cilist
  1396.  
  1397.             Type:     Builtin
  1398.  
  1399.             Default:  -l option
  1400.  
  1401.             Usage:    cilist [ -adrel ] [ patterns ... ]
  1402.  
  1403.             Range:    n/a
  1404.  
  1405.             About:    The  cilist (completion-ignore  list)  command pro-
  1406.                       vides  a  method   to   enhance  the  command  line
  1407.                       filename  completion mechanism.  It only  functions
  1408.                       if  SKsh  command  line  editing is  enabled.   The
  1409.                       cilist is used  to  store  patterns which should be
  1410.                       ignored  during file completion.   For  example, if
  1411.                       it  contained  the  patterns "*.info", "*.bak", and
  1412.                       "ZZ*",  file  completion  would  effectively ignore
  1413.                       files  matching any of those patterns.  This can be
  1414.                       useful if  there  are  certain types of files which
  1415.                       you wish to ignore during completion.
  1416.  
  1417.                       -a   Add  the  supplied  arguments to  the  cilist.
  1418.                            The  old  contents of the  list  are  left  in
  1419.                            place.
  1420.  
  1421.                       -d   Delete   the   supplied   arguments  from  the
  1422.                            cilist.
  1423.  
  1424.                       -r   Synonym for -d.
  1425.  
  1426.                       -e   Empty the cilist.
  1427.  
  1428.                       -l   List the  contents of the cilist, one name per
  1429.                            line.  If no  command line switches are given,
  1430.                            this is the default.
  1431.  
  1432.             Hints:    Please note the following:
  1433.  
  1434.                       *    The  patterns added to the  cilist must be es-
  1435.                            caped or quoted to avoid  being interpreted as
  1436.                            wildcards by  the  shell.   Alternatively, the
  1437.                            cilist  command itself can be added to the dw-
  1438.                            clist (see that command for details).
  1439.  
  1440.                       *    The  cilist  will  remove all entries matching
  1441.                            any of the given patterns.  This  includes en-
  1442.                            tries from the complist.
  1443.  
  1444.                       *    The  cilist can be null if you don't  wish  to
  1445.                            use this feature.
  1446.  
  1447.  
  1448.  
  1449.           SKsh Amiga Shell            Page 22             Reference Manual
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.             Example:  cilist -e     # empty the cilist
  1461.                       # now add these names...
  1462.                       cilist -a '*.info' '*.bak' '*~' '*.o'
  1463.  
  1464.             See Also: complist
  1465.  
  1466.           _________________________________________________________________
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.           SKsh Amiga Shell            Page 23             Reference Manual
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.           _________________________________________________________________
  1526.  
  1527.             Name:     clear, cls
  1528.  
  1529.             Type:     Alias
  1530.  
  1531.             Default:  echo -n $_ANSI_CLEAR
  1532.  
  1533.             Usage:    clear
  1534.  
  1535.             Range:    n/a
  1536.  
  1537.             About:    These aliases both  clear  the  screen  by  echoing
  1538.                       $_ANSI_CLEAR.
  1539.  
  1540.             Example:  clear
  1541.  
  1542.             See Also: _ANSI_CLEAR
  1543.  
  1544.           _________________________________________________________________
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.           SKsh Amiga Shell            Page 24             Reference Manual
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.           _________________________________________________________________
  1592.  
  1593.             Name:     CLINUM
  1594.  
  1595.             Type:     Variable
  1596.  
  1597.             Default:  n/a
  1598.  
  1599.             Usage:    $CLINUM
  1600.  
  1601.             Range:    1 to maximum process number limit
  1602.  
  1603.             About:    This  variable is set to the CLI  process number of
  1604.                       SKsh when it is started.
  1605.  
  1606.             Example:  echo "Process # = $CLINUM"
  1607.  
  1608.             See Also:
  1609.  
  1610.           _________________________________________________________________
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.           SKsh Amiga Shell            Page 25             Reference Manual
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.           _________________________________________________________________
  1658.  
  1659.             Name:     CMDNUM
  1660.  
  1661.             Type:     Variable
  1662.  
  1663.             Default:  n/a
  1664.  
  1665.             Usage:    $CMDNUM
  1666.  
  1667.             Range:    1 to 16 million
  1668.  
  1669.             About:    Each  time  SKsh  inputs a line from the  keyboard,
  1670.                       this variable is incremented.
  1671.  
  1672.             Example:  echo "$CMDNUM lines have been entered so far."
  1673.  
  1674.             See Also: history
  1675.  
  1676.           _________________________________________________________________
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.           SKsh Amiga Shell            Page 26             Reference Manual
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.           _________________________________________________________________
  1724.  
  1725.             Name:     COLUMNS
  1726.  
  1727.             Type:     Variable
  1728.  
  1729.             Default:  72
  1730.  
  1731.             Usage:    $COLUMNS
  1732.  
  1733.             Range:    15 to 130
  1734.  
  1735.             About:    This  variable is  one  of  several responsible for
  1736.                       controlling  the  actions of SKsh line  editing and
  1737.                       display output.   If  line  editing is enabled, and
  1738.                       the  cursor  moves  beyond the  column indicated by
  1739.                       this  variable, SKsh slides the line to the left by
  1740.                       12 characters.  SKsh  also  uses  this  variable to
  1741.                       truncate  the  output of certain internal SKsh com-
  1742.                       mands  (such  as  History).  This creates a cleaner
  1743.                       display.
  1744.  
  1745.                       This  variable  is  normally  set  automatically by
  1746.                       SKsh when the  window is resized, although this be-
  1747.                       havior can be disabled with the options command.
  1748.  
  1749.             Example:  COLUMNS=78
  1750.  
  1751.             See Also: PNPC, LINES, options
  1752.  
  1753.           _________________________________________________________________
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.           SKsh Amiga Shell            Page 27             Reference Manual
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.           _________________________________________________________________
  1790.  
  1791.             Name:     complist
  1792.  
  1793.             Type:     Builtin
  1794.  
  1795.             Default:  -l option
  1796.  
  1797.             Usage:    complist [ -adrel ] [ names ... ]
  1798.  
  1799.             Range:    n/a
  1800.  
  1801.             About:    The  complist  command  provides a method to extend
  1802.                       the  command  line  filename  completion mechanism.
  1803.                       It  only  functions if SKsh command line editing is
  1804.                       enabled.   SKsh   maintains an  internal completion
  1805.                       list  of  user  defined  strings.   When  <tab>  or
  1806.                       <esc><esc> are used  to  complete a string, the in-
  1807.                       ternal  completion list is consulted before comple-
  1808.                       tion  is  attempted on files.  If a match is  found
  1809.                       in the  internal completion list (even if it is but
  1810.                       a  partial  match),  it  is  used.   If  not,  then
  1811.                       filename  completion proceeds as normal.  An option
  1812.                       is  provided to turn on or off this  behaviour (see
  1813.                       the options command for details).
  1814.  
  1815.                       -a   Add  the  supplied arguments to the completion
  1816.                            list.  The  old  contents of the list are left
  1817.                            in place.
  1818.  
  1819.                       -d   Delete   the   supplied   arguments  from  the
  1820.                            completion list.
  1821.  
  1822.                       -r   Synonym for -d.
  1823.  
  1824.                       -e   Empty the completion list.
  1825.  
  1826.                       -l   List the  contents of the completion list, one
  1827.                            name per line.   If  no  command line switches
  1828.                            are given, this is the default.
  1829.  
  1830.             Hints:    The  completion list can, among  other  things,  be
  1831.                       used to:
  1832.  
  1833.                       *    Maintain  a  user  defined list of strings  to
  1834.                            contain, for  example, device or program names
  1835.                            (such  as  "graphics:" or  "calculator") which
  1836.                            are commonly typed.
  1837.  
  1838.                       *    Contain  programs names which are found in the
  1839.                            search path.
  1840.  
  1841.                       *    Buffer  the  contents of the current directory
  1842.                            so  that  subsequent successful completions do
  1843.  
  1844.  
  1845.           SKsh Amiga Shell            Page 28             Reference Manual
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.                            not have to read the  directory.   This  makes
  1856.                            filename  completion  usable on a floppy based
  1857.                            system or on a  hard  disk  when  a  directory
  1858.                            contains  a  large  number of files.  A  shell
  1859.                            function  is  supplied in the Stuff.sksh  file
  1860.                            which adds the files in the  current directory
  1861.                            to the completion list.
  1862.  
  1863.                       *    Perform  completion on files stored  inside of
  1864.                            a  zoo  archive.   A  function supplied in the
  1865.                            Stuff.sksh file  facilitates this process.  It
  1866.                            could also, with a little  work,  be  extended
  1867.                            to handle other archive types.
  1868.  
  1869.             Example:  complist -e     # empty the completion list
  1870.                       # now add these names...
  1871.                       complist -a graphics: my_program foo
  1872.  
  1873.             See Also: zget, cget (from Stuff.sksh)
  1874.                       options (+C)
  1875.  
  1876.           _________________________________________________________________
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.           SKsh Amiga Shell            Page 29             Reference Manual
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.           _________________________________________________________________
  1922.  
  1923.             Name:     continue
  1924.  
  1925.             Type:     Builtin
  1926.  
  1927.             Default:  n/a
  1928.  
  1929.             Usage:    continue [ num ]
  1930.  
  1931.             Range:    n/a
  1932.  
  1933.             About:    continue  resumes execution with the next iteration
  1934.                       of the  surrounding loop, or the nth subsequent it-
  1935.                       eration if given a numeric argument.
  1936.  
  1937.             Example:  for a in a b c d e f
  1938.                       do
  1939.                          echo $a
  1940.                          if [ "$a" = "c" ] then continue; fi
  1941.                          echo "This is not echoed when \$a = c"
  1942.                       done
  1943.  
  1944.             See Also: break
  1945.  
  1946.           _________________________________________________________________
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.           SKsh Amiga Shell            Page 30             Reference Manual
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.           _________________________________________________________________
  1988.  
  1989.             Name:     ctpri
  1990.  
  1991.             Type:     Alias
  1992.  
  1993.             Default:  ChangeTaskPri
  1994.  
  1995.             Usage:    ctpri
  1996.                       ctpri num
  1997.  
  1998.             Range:    -31 <= num <= 31
  1999.  
  2000.             About:    This  alias  is  provided as a shorter  alternative to
  2001.                       the  AmigaDos  ChangeTaskpri  command.   Its  use   is
  2002.                       identical.
  2003.  
  2004.             Example:  ctpri 1
  2005.  
  2006.             See Also: stack
  2007.  
  2008.           _________________________________________________________________
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.           SKsh Amiga Shell            Page 31             Reference Manual
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.           _________________________________________________________________
  2054.  
  2055.             Name:     date
  2056.  
  2057.             Type:     Builtin
  2058.  
  2059.             Default:  n/a
  2060.  
  2061.             Usage:    date [-aDmdty]
  2062.  
  2063.             Range:    n/a
  2064.  
  2065.             About:    Date  prints  the  current  date  as  a  24  character
  2066.                       string:
  2067.  
  2068.                          DDD mmm dd hh:mm:ss yyyy
  2069.  
  2070.                       Date  with  the  -a (all)  option is identical to date
  2071.                       with no  parameters, (which prints the date as above).
  2072.                       Date  -D prints  a  three  character representation of
  2073.                       the day of the  week.   Date -m prints a three charac-
  2074.                       ter  representation of the month.   Date -d prints the
  2075.                       day  number as  two  digits.   Date -t prints the time
  2076.                       string, and date -y prints the year as four digits.
  2077.  
  2078.             Example:  date -y    # find the year
  2079.  
  2080.             See Also: time
  2081.  
  2082.           _________________________________________________________________
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.           SKsh Amiga Shell            Page 32             Reference Manual
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.           _________________________________________________________________
  2120.  
  2121.             Name:     dec
  2122.  
  2123.             Type:     Builtin
  2124.  
  2125.             Default:  n/a
  2126.  
  2127.             Usage:    dec var [ count ]
  2128.  
  2129.             Range:    n/a
  2130.  
  2131.             About:    dec  decrements  the  contents of  the  variable by
  2132.                       count, or 1 if count is not given.  It  is  equiva-
  2133.                       lent  to,  but  faster  than,  'var=$(expr  $var  -
  2134.                       $count)'
  2135.  
  2136.             Example:  dec my_var 3
  2137.  
  2138.             See Also: inc
  2139.  
  2140.           _________________________________________________________________
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.           SKsh Amiga Shell            Page 33             Reference Manual
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.           _________________________________________________________________
  2186.  
  2187.             Name:     dir
  2188.  
  2189.             Type:     Alias
  2190.  
  2191.             Default:  ls -bF
  2192.  
  2193.             Usage:    dir [ file | dir ] ...
  2194.  
  2195.             Range:    n/a
  2196.  
  2197.             About:    dir prints a  short  format directory listing, with
  2198.                       only the basename of each file printed.  Note  that
  2199.                       the 'F' option to 'ls' is set.
  2200.  
  2201.             Example:  dir s:
  2202.  
  2203.             See Also: ls, ll
  2204.  
  2205.           _________________________________________________________________
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.           SKsh Amiga Shell            Page 34             Reference Manual
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.           _________________________________________________________________
  2252.  
  2253.             Name:     dirname
  2254.  
  2255.             Type:     Builtin
  2256.  
  2257.             Default:  n/a
  2258.  
  2259.             Usage:    complist [ -adel ] [ names ... ]
  2260.  
  2261.             Range:    n/a
  2262.  
  2263.             About:    dirname  prints  the  "directory" name of  a  given
  2264.                       path.  For  example, the dirname of sys:System/For-
  2265.                       mat  is  simply  sys:System.  If  dirname is passed
  2266.                       more than  one  parameter, it prints the dirname of
  2267.                       each parameter in turn.
  2268.  
  2269.             Example:  dirname sys:usr/bin/wc
  2270.  
  2271.             See Also: basename, extname
  2272.  
  2273.           _________________________________________________________________
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.           SKsh Amiga Shell            Page 35             Reference Manual
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.           _________________________________________________________________
  2318.  
  2319.             Name:     dwclist
  2320.  
  2321.             Type:     Builtin
  2322.  
  2323.             Default:  -l option
  2324.  
  2325.             Usage:    dwclist [ -adrel ] [ names ... ]
  2326.  
  2327.             Range:    n/a
  2328.  
  2329.             About:    The  dwclist  (disabled wildcard list) command pro-
  2330.                       vides  the  ability so selectively disable wildcard
  2331.                       expansion for  individual commands.  When expanding
  2332.                       wildcards, SKsh first checks  the  command name for
  2333.                       inclusion in the  dwclist.  If found, SKsh will not
  2334.                       expand  parameters  which  contain  wildcards,  but
  2335.                       rather, will pass these wildcards  to  the  command
  2336.                       directly.
  2337.  
  2338.                       The  dwclist is  very  useful for external programs
  2339.                       which  perform their own  wildcard  expansion.   By
  2340.                       putting  the  command in the dwclist, SKsh will let
  2341.                       that  command  perform its own wildcard  expansion,
  2342.                       thus  circumventing the 255  character command line
  2343.                       limit in AmigaDos 1.3.
  2344.  
  2345.                       An  option  is  provided to turn on or off this be-
  2346.                       haviour  (see  the  options  command for  details).
  2347.                       The default is to ignore the dwclist.
  2348.  
  2349.                       The  following  arguments, similar to those for the
  2350.                       complist command, are accepted:
  2351.  
  2352.                       -a   Add  the  supplied  arguments to the  dwclist.
  2353.                            The  old  contents of the  list  are  left  in
  2354.                            place.
  2355.  
  2356.                       -d   Delete   the   supplied   arguments  from  the
  2357.                            dwclist.
  2358.  
  2359.                       -r   Same as -d.
  2360.  
  2361.                       -e   Empty the dwclist.
  2362.  
  2363.                       -l   List  the  contents of  the  dwclist list, one
  2364.                            name per line.   If  no  command line switches
  2365.                            are given, this is the default.
  2366.  
  2367.             Hints:    The following should be noted:
  2368.  
  2369.                       *    The +w  option is not set by default.  It must
  2370.                            be set explicitly to use the dwclist feature.
  2371.  
  2372.  
  2373.           SKsh Amiga Shell            Page 36             Reference Manual
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.                       *    Use of long a  long  dwclist will slightly de-
  2385.                            grade  the  SKsh  interpreter performance, al-
  2386.                            though  commands in the  list  will  run  much
  2387.                            faster if passed parameters with wildcards.
  2388.  
  2389.                       *    SKsh searches for the first  argument verbatim
  2390.                            in  the  dwclist.  This means  that,  for  ex-
  2391.                            ample,  if  a  program is added to the list as
  2392.                            "myprog",  it  must  be  invoked in  the  same
  2393.                            manner.   Supplying a path name will not work,
  2394.                            unless  the  entire path is also added to  the
  2395.                            list.
  2396.  
  2397.                       *    SKsh  does  not  care  whether  entries in the
  2398.                            list are  external programs or internal built-
  2399.                            ins, functions, or aliases.
  2400.  
  2401.                       *    If an alias  or  a  function is used to invoke
  2402.                            an  external  command, both the alias or func-
  2403.                            tion name and  the  external command name must
  2404.                            appear in  the  dwclist.  Otherwise, SKsh will
  2405.                            attempt  to  expand the wildcards for the  one
  2406.                            not listed.
  2407.  
  2408.             Example:  dwclist -e     # empty the dwclist
  2409.                       # now add these names...
  2410.                       dwclist -a zoo lharc
  2411.  
  2412.             See Also: options (+w)
  2413.  
  2414.           _________________________________________________________________
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.           SKsh Amiga Shell            Page 37             Reference Manual
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.           _________________________________________________________________
  2450.  
  2451.             Name:     echo
  2452.  
  2453.             Type:     Builtin
  2454.  
  2455.             Default:  n/a
  2456.  
  2457.             Usage:    echo [-nc] [ parameter ... ]
  2458.  
  2459.             Range:    n/a
  2460.  
  2461.             About:    The  echo command simply prints its arguments to stan-
  2462.                       dard  output.   If  given  no   arguments, it prints a
  2463.                       newline.    Otherwise, it prints its  arguments, sepa-
  2464.                       rated by a single space,  unless the -c option is set,
  2465.                       in which case  no  separating spaces are printed (con-
  2466.                       catenation  mode).   Echo   normally prints a trailing
  2467.                       newline,  unless  the  -n option is set, in which case
  2468.                       no trailing newline is printed.
  2469.  
  2470.                       'echo -c' is useful for concatenating strings:
  2471.  
  2472.                          result = $(echo -c This '+' That)
  2473.  
  2474.             Example:  echo 'These' 'arguments' are "echoed"
  2475.  
  2476.             See Also:
  2477.  
  2478.           _________________________________________________________________
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.           SKsh Amiga Shell            Page 38             Reference Manual
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.           _________________________________________________________________
  2516.  
  2517.             Name:     eval
  2518.  
  2519.             Type:     Builtin
  2520.  
  2521.             Default:  n/a
  2522.  
  2523.             Usage:    eval [ string ... ]
  2524.  
  2525.             Range:    n/a
  2526.  
  2527.             About:    eval executes the text of the supplied  strings  as
  2528.                       if they were  SKsh  commands.   If  more  than  one
  2529.                       string is given, they are evaluated in order.
  2530.  
  2531.             Example:  foo='for a in a b c; do; echo $a; done'
  2532.                       eval "$foo" 'echo boo'
  2533.  
  2534.             See Also:
  2535.  
  2536.           _________________________________________________________________
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.           SKsh Amiga Shell            Page 39             Reference Manual
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.           _________________________________________________________________
  2582.  
  2583.             Name:     exit
  2584.  
  2585.             Type:     Builtin
  2586.  
  2587.             Default:  n/a
  2588.  
  2589.             Usage:    exit [ code ]
  2590.  
  2591.             Range:    n/a
  2592.  
  2593.             About:    exit leaves  SKsh,  returning execution back to the
  2594.                       invoking  shell.   If  invoked with a numeric argu-
  2595.                       ment,  it  returns that exit code to  the  invoking
  2596.                       shell or program.
  2597.  
  2598.                       Note  that  exit  always  exits SKsh entirely.   To
  2599.                       simply exit a  script  or  function, use the return
  2600.                       statement.   If  the   LOGOUT  variable is defined,
  2601.                       exit will execute that string before terminating.
  2602.  
  2603.             Example:  exit    # exits successfully
  2604.  
  2605.             See Also: return, LOGOUT
  2606.  
  2607.           _________________________________________________________________
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.           SKsh Amiga Shell            Page 40             Reference Manual
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.           _________________________________________________________________
  2648.  
  2649.             Name:     export
  2650.  
  2651.             Type:     Builtin
  2652.  
  2653.             Default:  n/a
  2654.  
  2655.             Usage:    export [ -l ] [ var ... ]
  2656.  
  2657.             Range:    n/a
  2658.  
  2659.             About:    export  (without  the  -l  option) does two things.
  2660.                       It sets the  value  of  the  indicated variables in
  2661.                       the  topmost  symbol table in SKsh, and it sets  an
  2662.                       AmigaDos  environment  variable with the same  name
  2663.                       and value.  This is the only way to  transfer vari-
  2664.                       able values between executions of SKsh.
  2665.  
  2666.                       export  with  the  -l  option only sets the topmost
  2667.                       symbol table of SKsh, but not  the  AmigaDos  envi-
  2668.                       ronment variable.  This  is  faster  and  does  not
  2669.                       clutter up  the  environment with unneeded variable
  2670.                       definitions.
  2671.  
  2672.             Example:  export -l my_var1 my_var2
  2673.  
  2674.             See Also: getenv
  2675.  
  2676.           _________________________________________________________________
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.           SKsh Amiga Shell            Page 41             Reference Manual
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.           _________________________________________________________________
  2714.  
  2715.             Name:     expr
  2716.  
  2717.             Type:     Keyword
  2718.  
  2719.             Default:  n/a
  2720.  
  2721.             Usage:    expr length string
  2722.                       expr num_expression
  2723.                       expr index str pattern
  2724.                       expr substr num1 num2
  2725.  
  2726.             Range:    n/a
  2727.  
  2728.             About:    expr   evaluates  and  prints  the  results  of  an
  2729.                       expression.
  2730.  
  2731.                       expr length string
  2732.  
  2733.                          prints the length in characters of the string
  2734.  
  2735.                       expr num_expression
  2736.  
  2737.                          prints the  result of evaluating num_expression.
  2738.                          num_expression  is  an  integer  expression com-
  2739.                          puted with 32  bit  integers.   '+',  '-',  '*',
  2740.                          '/', and '%' can be used.   '*',  '/',  and  '%'
  2741.                          have a higher  precedence than '+' and '-'; oth-
  2742.                          erwise,  the  expression  is  evaluated left  to
  2743.                          right.  Parentheses can be used.
  2744.  
  2745.                       expr index str pattern
  2746.  
  2747.                          prints  the  index  of  pattern if found in  the
  2748.                          string, or 0 if not found.  The  first  position
  2749.                          in string is 1, not 0.   Unlike ksh, pattern can
  2750.                          be more than one character.
  2751.  
  2752.                       expr substr string num1 num2
  2753.  
  2754.                          prints the substring of the  string  starting at
  2755.                          the  position  indicated by num1  and  extending
  2756.                          for  num2  characters.   The   beginning of  the
  2757.                          string is at position one, not 0.
  2758.  
  2759.             Example:  expr 3 * ( 1 + 4 )
  2760.                       expr length "foo"
  2761.                       expr index 'foobarnot' 'bar'
  2762.                       expr substr 'foobarnot' 4 3
  2763.  
  2764.             See Also:
  2765.  
  2766.           _________________________________________________________________
  2767.  
  2768.  
  2769.           SKsh Amiga Shell            Page 42             Reference Manual
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.           _________________________________________________________________
  2780.  
  2781.             Name:     extname
  2782.  
  2783.             Type:     Builtin
  2784.  
  2785.             Default:  n/a
  2786.  
  2787.             Usage:    extname [ -v ] [ fspec ]
  2788.  
  2789.             Range:    n/a
  2790.  
  2791.             About:    extname prints the  "extension"  of  a  given  path
  2792.                       name.  For example, the extension of  my_file.c  is
  2793.                       simply 'c'.
  2794.  
  2795.                       When used with the "-v"  flag,  extname prints that
  2796.                       part  of  the  file  name  which  is  not  in   the
  2797.                       extension.
  2798.  
  2799.             Example:  extname my_file.c
  2800.  
  2801.             See Also: basename, dirname
  2802.  
  2803.           _________________________________________________________________
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.           SKsh Amiga Shell            Page 43             Reference Manual
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.           _________________________________________________________________
  2846.  
  2847.             Name:     false
  2848.  
  2849.             Type:     Builtin
  2850.  
  2851.             Default:  n/a
  2852.  
  2853.             Usage:    false
  2854.  
  2855.             Range:    n/a
  2856.  
  2857.             About:    false  simply  returns a false exit code, and  does
  2858.                       nothing else.
  2859.  
  2860.             Example:  if false
  2861.                       then
  2862.                          echo 'This will never echo'
  2863.                       fi
  2864.  
  2865.             See Also: true
  2866.  
  2867.           _________________________________________________________________
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.           SKsh Amiga Shell            Page 44             Reference Manual
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.           _________________________________________________________________
  2912.  
  2913.             Name:     for/do/done
  2914.  
  2915.             Type:     Keywords
  2916.  
  2917.             Default:  n/a
  2918.  
  2919.             Usage:    for var in list do stmt_list done
  2920.  
  2921.             Range:    n/a
  2922.  
  2923.             About:    The  variable is set to each value in list, and for
  2924.                       each value, the statement list is executed.
  2925.  
  2926.             Example:  for file in *.h *.c
  2927.                       do
  2928.                          cp $file $file.bak
  2929.                       done
  2930.  
  2931.             See Also: while
  2932.  
  2933.           _________________________________________________________________
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.           SKsh Amiga Shell            Page 45             Reference Manual
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.           _________________________________________________________________
  2978.  
  2979.             Name:     force
  2980.  
  2981.             Type:     Keyword
  2982.  
  2983.             Default:  n/a
  2984.  
  2985.             Usage:    force [ -fba ] command [ parameter ... ]
  2986.  
  2987.             Range:    n/a
  2988.  
  2989.             About:    force forces SKsh  to  interpret command as a func-
  2990.                       tion,  builtin, or alias.   Exactly one of the 'f',
  2991.                       'b', and 'a' flags must be present.   force is use-
  2992.                       ful if the builtin commands are redefined.
  2993.  
  2994.             Example:  function date {
  2995.                          echo -n 'The date is: '
  2996.                          force -b date
  2997.                       }
  2998.  
  2999.             See Also:
  3000.  
  3001.           _________________________________________________________________
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.           SKsh Amiga Shell            Page 46             Reference Manual
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.           _________________________________________________________________
  3044.  
  3045.             Name:     function
  3046.  
  3047.             Type:     Keyword
  3048.  
  3049.             Default:  n/a
  3050.  
  3051.             Usage:    function name { stmt_list }
  3052.  
  3053.             Range:    n/a
  3054.  
  3055.             About:    function  defines an SKsh function called name, and
  3056.                       with the definition given by the statement list.
  3057.  
  3058.             Example:  function my_func {
  3059.                          echo "I was passed $# parameters"
  3060.                       }
  3061.  
  3062.             See Also: functions
  3063.  
  3064.           _________________________________________________________________
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.           SKsh Amiga Shell            Page 47             Reference Manual
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.           _________________________________________________________________
  3110.  
  3111.             Name:     functions
  3112.  
  3113.             Type:     Alias
  3114.  
  3115.             Default:  set -f
  3116.  
  3117.             Usage:    functions [ pattern... ]
  3118.  
  3119.             Range:    n/a
  3120.  
  3121.             About:    This  alias  lists  defined functions.  The pattern
  3122.                       uses  normal wildcards, but must be quoted to avoid
  3123.                       being   interpreted  by  the   filename   expansion
  3124.                       mechanism.   If  the  pattern is omitted, all func-
  3125.                       tions  are  listed  except those  beginning with an
  3126.                       underscore character (hidden functions).
  3127.  
  3128.                       Only  functions for the current context are listed,
  3129.                       so this  command may have a different effect inside
  3130.                       of   a   subshell  or   function  than  when  typed
  3131.                       manually.
  3132.  
  3133.             Example:  functions '[a-h]*'
  3134.  
  3135.             See Also: set
  3136.  
  3137.           _________________________________________________________________
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.           SKsh Amiga Shell            Page 48             Reference Manual
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.           _________________________________________________________________
  3176.  
  3177.             Name:     getenv
  3178.  
  3179.             Type:     Builtin
  3180.  
  3181.             Default:  n/a
  3182.  
  3183.             Usage:    getenv [ var ... ]
  3184.  
  3185.             Range:    n/a
  3186.  
  3187.             About:    getenv  imports  the  values of the indicated vari-
  3188.                       able from  AmigaDos  environment variables with the
  3189.                       same  names.   This   command, coupled with  export
  3190.                       command,  allows  variables to  be  transferred be-
  3191.                       tween executions of SKsh.
  3192.  
  3193.             Example:  getenv my_var1 my_var2
  3194.  
  3195.             See Also: export
  3196.  
  3197.           _________________________________________________________________
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.           SKsh Amiga Shell            Page 49             Reference Manual
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.           _________________________________________________________________
  3242.  
  3243.             Name:     history
  3244.  
  3245.             Type:     Builtin
  3246.  
  3247.             Default:  n/a
  3248.  
  3249.             Usage:    history
  3250.                       history -n
  3251.                       history -e [ pattern | number | offset ]
  3252.  
  3253.             Range:    n/a
  3254.  
  3255.             About:    SKsh  maintains the HISTSIZE previous commands in a
  3256.                       list so that they may later  be  recalled or edited
  3257.                       for re-execution.
  3258.  
  3259.                       history  with no  parameters simply prints the his-
  3260.                       tory list, with  each  line  prefixed by the number
  3261.                       of  the  associated  command.   The  -n   parameter
  3262.                       leaves out the line numbers.
  3263.  
  3264.                       history  -e is  used  to  execute commands from the
  3265.                       history list.  If  given  a  positive numeric argu-
  3266.                       ment, it  executes the history command at that num-
  3267.                       ber (note that these  numbers are derived from CMD-
  3268.                       NUM and do not  always begin at 1 if CMDNUM > HIST-
  3269.                       SIZE).  If given  a  negative numeric argument, the
  3270.                       line  executed  is  the  'nth'  before the current;
  3271.                       thus,  the  example  below  executes  the  previous
  3272.                       command.  If  the  argument is a string or pattern,
  3273.                       the  most  recent command containing that string or
  3274.                       pattern is executed.
  3275.  
  3276.             Example:  history -e -1    # execute previous command
  3277.  
  3278.             See Also: HISTSIZE, !, !!, CMDNUM, command  line  editing  in
  3279.                       the User's Manual.
  3280.  
  3281.           _________________________________________________________________
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.           SKsh Amiga Shell            Page 50             Reference Manual
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.           _________________________________________________________________
  3308.  
  3309.             Name:     HISTSIZE
  3310.  
  3311.             Type:     Variable
  3312.  
  3313.             Default:  32
  3314.  
  3315.             Usage:    $HISTSIZE
  3316.  
  3317.             Range:    0 to 32000
  3318.  
  3319.             About:    SKsh keeps a list  of  the  $HISTSIZE  most  recent
  3320.                       commands available for editing and re-entry.
  3321.  
  3322.             Example:  HISTSIZE=64
  3323.  
  3324.             See Also: history, options
  3325.  
  3326.           _________________________________________________________________
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.           SKsh Amiga Shell            Page 51             Reference Manual
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.           _________________________________________________________________
  3374.  
  3375.             Name:     HOME
  3376.  
  3377.             Type:     Variable
  3378.  
  3379.             Default:  :
  3380.  
  3381.             Usage:    $HOME
  3382.  
  3383.             Range:    n/a
  3384.  
  3385.             About:    This  variable  represents the  default destination
  3386.                       for  the  cd command.  It can be set to  any  valid
  3387.                       directory name.
  3388.  
  3389.             Example:  HOME=.
  3390.  
  3391.             See Also: cd
  3392.  
  3393.           _________________________________________________________________
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.           SKsh Amiga Shell            Page 52             Reference Manual
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.           _________________________________________________________________
  3440.  
  3441.             Name:     if/then/elif/else/fi
  3442.  
  3443.             Type:     Keywords
  3444.  
  3445.             Default:  n/a
  3446.  
  3447.             Usage:    if expr then stmt_list
  3448.                          [ [ elif expr then stmt_list ] ... ]
  3449.                          [ else stmt_list ] fi
  3450.  
  3451.             Range:    n/a
  3452.  
  3453.             About:    If  the  expression is true (that is, it  returns a
  3454.                       zero  exit  status), then the first  statement list
  3455.                       is executed.  If  any  elif statements are present,
  3456.                       each  expression  is  executed, and if it is  true,
  3457.                       execution  procedes  for  the  associated statement
  3458.                       list.  If none  of  the  expressions were true, the
  3459.                       else statement_list is executed.
  3460.  
  3461.                       The  expressions can be any  command, or a test ex-
  3462.                       pression  surrounded  by  square  brackets (see the
  3463.                       user's manual for details).
  3464.  
  3465.             Example:  if [ ! -f name -a ! -d name ]
  3466.                       then
  3467.                          mkdir name
  3468.                       else
  3469.                          echo "$name exists already!"
  3470.                       fi
  3471.  
  3472.             See Also: while
  3473.  
  3474.           _________________________________________________________________
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.           SKsh Amiga Shell            Page 53             Reference Manual
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.           _________________________________________________________________
  3506.  
  3507.             Name:     IFS
  3508.  
  3509.             Type:     Variable
  3510.  
  3511.             Default:  " \n\t"
  3512.  
  3513.             Usage:    $IFS
  3514.  
  3515.             Range:    n/a
  3516.  
  3517.             About:    Characters in IFS are  used  to  break  substituted
  3518.                       text  (from  variables  and  command  substitution)
  3519.                       into parameters.  If IFS is set to the null  string
  3520.                       (''),  all   substituted  text  will  be  a  single
  3521.                       parameter.
  3522.  
  3523.                       If the  'i'  option to SKsh is set (see the options
  3524.                       command), the  IFS  characters will also be used to
  3525.                       break text from $( ) style command substitution.
  3526.  
  3527.             Example:  [dh0:]: IFS=" \n\t"
  3528.                       [dh0:]: a='Now   is   the   time'
  3529.                       [dh0:]: echo $a
  3530.                               Now is the time
  3531.                       [dh0:]: IFS=''
  3532.                       [dh0:]: echo $a
  3533.                               Now   is   the   time
  3534.  
  3535.             See Also:
  3536.  
  3537.           _________________________________________________________________
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.           SKsh Amiga Shell            Page 54             Reference Manual
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.           _________________________________________________________________
  3572.  
  3573.             Name:     inc
  3574.  
  3575.             Type:     Builtin
  3576.  
  3577.             Default:  n/a
  3578.  
  3579.             Usage:    inc var [ count ]
  3580.  
  3581.             Range:    n/a
  3582.  
  3583.             About:    inc  increments  the  contents of  the  variable by
  3584.                       count, or 1 if count is not given.  It  is  equiva-
  3585.                       lent  to,  but  faster  than,  'var=$(expr  $var  +
  3586.                       $count)'
  3587.  
  3588.             Example:  inc my_var 3
  3589.  
  3590.             See Also: dec
  3591.  
  3592.           _________________________________________________________________
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.           SKsh Amiga Shell            Page 55             Reference Manual
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.           _________________________________________________________________
  3638.  
  3639.             Name:     info
  3640.  
  3641.             Type:     Builtin
  3642.  
  3643.             Default:  n/a
  3644.  
  3645.             Usage:    info [ -a ] [ device | directory ] ...
  3646.  
  3647.             Range:    n/a
  3648.  
  3649.             About:    info  reports the amount of free space available on
  3650.                       a  given  device or  directory.   It  prints  total
  3651.                       space  in  kilobytes, used space in  kilobytes, the
  3652.                       free space  in  kilobytes, the state of the device,
  3653.                       the  number of bytes per block, the  percentage ca-
  3654.                       pacity  utilization,  the  total  number of errors,
  3655.                       and the  volume name.  If info is given a directory
  3656.                       name as an  argument, the free space for the direc-
  3657.                       tory is the same as the free space for  the  device
  3658.                       on which the directory resides.
  3659.  
  3660.                       The  SKsh  info  command  reports data in 1024 byte
  3661.                       kilobytes, not 1000 byte kilobytes.  This may  lead
  3662.                       to  a  slightly  different  answer than other  info
  3663.                       commands.   The  SKsh   info command will deal cor-
  3664.                       rectly   with   file   systems  of  up  to  several
  3665.                       gigabytes  (should  you   happen  to  have  one  of
  3666.                       those).
  3667.  
  3668.  
  3669.                       If  the  info command is given the -a flag, it will
  3670.                       report  information on  all  the  currently mounted
  3671.                       devices.
  3672.  
  3673.  
  3674.             Example:  info sys: ram: df0:
  3675.                       info -a       # info for all devices
  3676.  
  3677.             See Also:
  3678.  
  3679.           _________________________________________________________________
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.           SKsh Amiga Shell            Page 56             Reference Manual
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.           _________________________________________________________________
  3704.  
  3705.             Name:     INTERACTIVE
  3706.  
  3707.             Type:     Variable
  3708.  
  3709.             Default:  TRUE for interactive sessions
  3710.                       FALSE otherwise
  3711.  
  3712.             Usage:    $INTERACTIVE
  3713.  
  3714.             Range:    TRUE or FALSE
  3715.  
  3716.             About:    This variable stores  the  string  "TRUE"  if  this
  3717.                       SKsh   session   is   interactive,   and    "FALSE"
  3718.                       otherwise.  For example, if SKsh is started via:
  3719.  
  3720.                         sksh -c "mycommand string"
  3721.                       or
  3722.                         sksh myscript.sksh
  3723.  
  3724.                       the INTERACTIVE variable will contain  "FALSE",  as
  3725.                       SKsh will simply execute the  commands  or  scripts
  3726.                       and exit immediately thereafter.  However, if  SKsh
  3727.                       is started such that the prompt  is  displayed  and
  3728.                       commands  may   be   typed   from   the   keyboard,
  3729.                       INTERACTIVE will be set to TRUE.
  3730.  
  3731.                       Currently, the .skshrc  file  is  not  sourced  for
  3732.                       non-interactive sessions.  This is to  prevent  any
  3733.                       output from the .skshrc  from  appearing  when  not
  3734.                       desired.  However, an  unfortunate  side-effect  of
  3735.                       this is that any aliases, functions, and  variables
  3736.                       set up in the .skshrc file  are  not  available  to
  3737.                       the  non-interactive  invocation  of   SKsh.    The
  3738.                       INTERACTIVE  variable  is  intended  to  provide  a
  3739.                       workaround for this problem.  It can be tested  for
  3740.                       in the .skshrc file, and certain actions  can  take
  3741.                       place  only  for  interactive  sessions  (See   the
  3742.                       example below).
  3743.  
  3744.                       In SKsh 1.6, the .skshrc file is still not  sourced
  3745.                       for non-interactive sessions.  However,  this  will
  3746.                       change in SKsh  1.7,  so  you  should  modify  your
  3747.                       .skshrc file accordingly.
  3748.  
  3749.             Example:  The following can be used as a test in .skshrc:
  3750.  
  3751.                       if [ "$INTERACTIVE" = 'true' ]
  3752.                       then
  3753.                          echo "\nWelcome to SKsh\n"
  3754.                       fi
  3755.  
  3756.             Notes:    You may also want to put the following  statements,
  3757.  
  3758.  
  3759.           SKsh Amiga Shell            Page 57             Reference Manual
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.                       if used, inside the interactive test:
  3770.  
  3771.                         complist
  3772.                         cilist
  3773.                         statements which set HISTSIZE, MAXDIST,
  3774.                         function key variables, etc.
  3775.  
  3776.             See Also: sksh, SKSHINIT
  3777.  
  3778.           _________________________________________________________________
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.           SKsh Amiga Shell            Page 58             Reference Manual
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.           _________________________________________________________________
  3836.  
  3837.             Name:     LASTRC
  3838.  
  3839.             Type:     Variable
  3840.  
  3841.             Default:  n/a
  3842.  
  3843.             Usage:    $LASTRC
  3844.  
  3845.             Range:    n/a
  3846.  
  3847.             About:    LASTRC stores the  return code from the last exter-
  3848.                       nal  command which was executed.  It is  not  reset
  3849.                       by  subsequent internal command return codes, as is
  3850.                       $?.
  3851.  
  3852.             Example:  some_external_command
  3853.                       echo
  3854.                       if [ $LASTRC -ne 0 ]
  3855.                       then
  3856.                          echo 'command failed!'
  3857.                       fi
  3858.  
  3859.             See Also: $?
  3860.  
  3861.           _________________________________________________________________
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.           SKsh Amiga Shell            Page 59             Reference Manual
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.           _________________________________________________________________
  3902.  
  3903.             Name:     LINES
  3904.  
  3905.             Type:     Variable
  3906.  
  3907.             Default:  24
  3908.  
  3909.             Usage:    $LINES
  3910.  
  3911.             Range:    3 to anything
  3912.  
  3913.             About:    This  variable is currently not used by SKsh; it is
  3914.                       provided  for  future  expansion, and for other ap-
  3915.                       plications or programs which might be interested.
  3916.  
  3917.                       This  variable  is  automatically set by SKsh  when
  3918.                       the  window  is  resized.   This   behavior can  be
  3919.                       turned off with the options command.
  3920.  
  3921.             Example:  if [ $LINES -lt 20 ]
  3922.                       then
  3923.                          echo "We require at least 20 lines!"
  3924.                       fi
  3925.  
  3926.             See Also: COLUMNS, options
  3927.  
  3928.           _________________________________________________________________
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.           SKsh Amiga Shell            Page 60             Reference Manual
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.           _________________________________________________________________
  3968.  
  3969.             Name:     ll
  3970.  
  3971.             Type:     Alias
  3972.  
  3973.             Default:  ls -lbF
  3974.  
  3975.             Usage:    ll [ file | dir ] ...
  3976.  
  3977.             Range:    n/a
  3978.  
  3979.             About:    ll  prints  a  long  format directory listing, with
  3980.                       only the basename of each file printed.  Note  that
  3981.                       the 'F' option to 'ls' is set.
  3982.  
  3983.             Example:  ll s:
  3984.  
  3985.             See Also: dir, ls
  3986.  
  3987.           _________________________________________________________________
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.           SKsh Amiga Shell            Page 61             Reference Manual
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.           _________________________________________________________________
  4034.  
  4035.             Name:     LLMIN
  4036.  
  4037.             Type:     Variable
  4038.  
  4039.             Default:  4
  4040.  
  4041.             Usage:    $LLMIN
  4042.  
  4043.             Range:    0 to 1023 inclusive
  4044.  
  4045.             About:    LLMIN  stores  the  minimum command line length for
  4046.                       which SKsh will  store  the  line  in  the  history
  4047.                       list.   Put   another way, lines shorter than  this
  4048.                       value are not  inserted into the history list.  For
  4049.                       example, a  line  containing only "cd" would be ig-
  4050.                       nored, as it is just as easy to re-type  as  it  is
  4051.                       to search for in the history list.
  4052.  
  4053.             Example:  LLMIN=0 # don't ignore any lines, even short ones
  4054.  
  4055.             See Also: MAXDIST, options
  4056.  
  4057.           _________________________________________________________________
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.           SKsh Amiga Shell            Page 62             Reference Manual
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.           _________________________________________________________________
  4100.  
  4101.             Name:     local
  4102.  
  4103.             Type:     Builtin
  4104.  
  4105.             Default:  n/a
  4106.  
  4107.             Usage:    local [ varname ... ]
  4108.  
  4109.             Range:    n/a
  4110.  
  4111.             About:    The  local  command can be used to enforce the cre-
  4112.                       ation of  local variables if the 'N' option and the
  4113.                       'l' to SKsh  are  set  (see  the  options command).
  4114.                       Normally with the  'N'  option set, local variables
  4115.                       are  created only if  they  had  not  been  created
  4116.                       first in  an  enclosing context.  The local command
  4117.                       makes  them  local even if there had been a  previ-
  4118.                       ously  defined  variable of the same name in an en-
  4119.                       closing context.  Note that this  command will have
  4120.                       no  effect if SKsh  local variables are disabled by
  4121.                       turning off the 'l' option.
  4122.  
  4123.             Example:  function my_func {
  4124.                          local answer;
  4125.                          answer = 42
  4126.                       }
  4127.  
  4128.             See Also: options
  4129.  
  4130.           _________________________________________________________________
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.           SKsh Amiga Shell            Page 63             Reference Manual
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.           _________________________________________________________________
  4166.  
  4167.             Name:     LOGOUT
  4168.  
  4169.             Type:     Variable
  4170.  
  4171.             Default:  'echo "\nBye!\n"'
  4172.  
  4173.             Usage:    $LOGOUT
  4174.  
  4175.             Range:    n/a
  4176.  
  4177.             About:    The text of this variable is executed by SKsh  when
  4178.                       the exit command is used to terminate execution.
  4179.  
  4180.             Example:  LOGOUT='';    # do nothing
  4181.  
  4182.             See Also: exit
  4183.  
  4184.           _________________________________________________________________
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.           SKsh Amiga Shell            Page 64             Reference Manual
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.           _________________________________________________________________
  4232.  
  4233.             Name:     ls
  4234.  
  4235.             Type:     Builtin
  4236.  
  4237.             Default:  n/a
  4238.  
  4239.             Usage:    ls [ -aldhi1bvF ] [ dirname | fname ] ...
  4240.  
  4241.             Range:    n/a
  4242.  
  4243.             About:    This  command is used  to  obtain information about
  4244.                       files or directories.  With  no  arguments, it sim-
  4245.                       ply lists  the  contents of the current working di-
  4246.                       rectory,  leaving out  files  beginning with a dot.
  4247.                       If the  'I'  option to SKsh is set (see the options
  4248.                       command), all .info files are also left  out  (this
  4249.                       feature exists because I hate .info files).
  4250.  
  4251.                       The  'a'  option causes  ls to list files beginning
  4252.                       with a dot.   Similarly, the 'i' option lists .info
  4253.                       files even if the  'I'  option to SKsh is set.  The
  4254.                       'h' option lists files with the hidden bit set.
  4255.  
  4256.                       The  'l'  option  creates a long  format list, with
  4257.                       filename,   protection  status,  byte  size,  block
  4258.                       size,  and  modification date listed.  (The ll com-
  4259.                       mand has been aliased  to  'ls  -l'  to  make  this
  4260.                       easier).
  4261.  
  4262.                       The  '1'  option  creates a short  format list with
  4263.                       one  column  instead  of  three  (useful for piping
  4264.                       filenames into a command).
  4265.  
  4266.                       The 'd'  option forces directories to be printed as
  4267.                       such.    Normally if the  ls command is given a di-
  4268.                       rectory as  an  argument, it prints the contents of
  4269.                       that directory.  The 'd'  option prints information
  4270.                       on  the  directory itself.  This is useful with the
  4271.                       'l'  option to find  the  modification date or pro-
  4272.                       tection status of a directory.
  4273.  
  4274.                       The  'b'  option causes only the basename  of  each
  4275.                       file to be printed.   Normally, if a path to a file
  4276.                       is given, SKsh will print the  path  information in
  4277.                       each  entry  in  the  ls output.   The  'b'  option
  4278.                       leaves out the path  information, printing only the
  4279.                       basename.
  4280.  
  4281.                       The  'v'  option prints a count  of  entries listed
  4282.                       after  the  listing  itself.   Also,  a  total byte
  4283.                       count is printed, which is the sum of the sizes  of
  4284.                       each file listed.
  4285.  
  4286.  
  4287.           SKsh Amiga Shell            Page 65             Reference Manual
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.                       The 'F'  option instructs 'ls' to output the appro-
  4299.                       priate _FILE_S, _FILE_E, _DIR_S,  _DIR_E,  _EXEC_S,
  4300.                       and  _EXEC_E  variables  before and after each file
  4301.                       name printed in  either the short or long directory
  4302.                       format.  See  the  documentation on those variables
  4303.                       for details on their usage.
  4304.  
  4305.                       The short form  of  the  ls command normally prints
  4306.                       the files in columns.   To  decide how many columns
  4307.                       there  should  be,  it  examines the $COLUMNS vari-
  4308.                       able,  divides  the  result by the  length  of  the
  4309.                       longest file name to  be  printed,  and  insures at
  4310.                       least a three character gutter between columns.
  4311.  
  4312.                       The  ls  command outputs an error message if passed
  4313.                       an  argument  which  does  not  exist as a file  or
  4314.                       directory.
  4315.  
  4316.             Example:  ls -li my_dir   # list my_dir including info files
  4317.  
  4318.             See Also: options, dir, ll
  4319.  
  4320.           _________________________________________________________________
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.           SKsh Amiga Shell            Page 66             Reference Manual
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.           _________________________________________________________________
  4364.  
  4365.             Name:     match
  4366.  
  4367.             Type:     Builtin
  4368.  
  4369.             Default:  n/a
  4370.  
  4371.             Usage:    match [ -v ] pattern [ string ... ]
  4372.  
  4373.             Range:    n/a
  4374.  
  4375.             About:    match prints each string that matches  the  pattern
  4376.                       given in the  first  argument.   The  pattern is of
  4377.                       the same type used by SKsh for filename  wildcards,
  4378.                       but it must be quoted  to  avoid  being expanded in
  4379.                       that manner.  If the 'v' flag is set, only  strings
  4380.                       not matching the pattern are printed.
  4381.  
  4382.             Example:  match '*.[ch]' file1.foo file1.c file2.h my_file
  4383.  
  4384.             See Also:
  4385.  
  4386.           _________________________________________________________________
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.           SKsh Amiga Shell            Page 67             Reference Manual
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.           _________________________________________________________________
  4430.  
  4431.             Name:     MAXDIST
  4432.  
  4433.             Type:     Variable
  4434.  
  4435.             Default:  5
  4436.  
  4437.             Usage:    $MAXDIST
  4438.  
  4439.             Range:    0 to 32000 inclusive
  4440.  
  4441.             About:    When  a  command is  entered from the keyboard with
  4442.                       line  editing enabled, SKsh checks for an identical
  4443.                       line  in  the  history list.  If one is found  less
  4444.                       than $MAXDIST lines away, the new one  is  not  en-
  4445.                       tered into the  history list.  This has two benefi-
  4446.                       cial effects.  First, if  the  same  command is en-
  4447.                       tered  several times in a row, it will only  appear
  4448.                       once in  the  history list.  Second, commands which
  4449.                       have not  been  entered for a long time will be en-
  4450.                       tered again so they do not scroll  of  the  end  of
  4451.                       the list.   This  rule  applies whether the command
  4452.                       was typed or  accessed from a previous history list
  4453.                       entry.
  4454.  
  4455.             Example:  MAXDIST=10 # re-enter lines if they get too far
  4456.  
  4457.             See Also: LLMIN, options
  4458.  
  4459.           _________________________________________________________________
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.           SKsh Amiga Shell            Page 68             Reference Manual
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.           _________________________________________________________________
  4496.  
  4497.             Name:     mem
  4498.  
  4499.             Type:     Builtin
  4500.  
  4501.             Default:  n/a
  4502.  
  4503.             Usage:    mem [ -tcf ]
  4504.  
  4505.             Range:    n/a
  4506.  
  4507.             About:    mem  reports the  amount  of  free  chip  and  fast
  4508.                       memory, as well as a total.  If  the  't'  flag  is
  4509.                       set,  only  the  total is printed.  If the  'c'  is
  4510.                       set, only chip memory is listed,  and  if  the  'f'
  4511.                       flag is set, only fast memory is listed.
  4512.  
  4513.             Example:  if [ $(mem -t) -lt 400000 ]
  4514.                       then
  4515.                          echo 'you must have at least 400K free'
  4516.                       fi
  4517.  
  4518.             See Also:
  4519.  
  4520.           _________________________________________________________________
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.           SKsh Amiga Shell            Page 69             Reference Manual
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.           _________________________________________________________________
  4562.  
  4563.             Name:     mkdir
  4564.  
  4565.             Type:     Builtin
  4566.  
  4567.             Default:  n/a
  4568.  
  4569.             Usage:    mkdir [ dirname ... ]
  4570.  
  4571.             Range:    n/a
  4572.  
  4573.             About:    mkdir  creates  directories with names identical to
  4574.                       the parameters passed to it.
  4575.  
  4576.             Example:  mkdir my_dir sys:system/my_other_dir
  4577.  
  4578.             See Also: rmdir
  4579.  
  4580.           _________________________________________________________________
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.           SKsh Amiga Shell            Page 70             Reference Manual
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.           _________________________________________________________________
  4628.  
  4629.             Name:     mplist
  4630.  
  4631.             Type:     Builtin
  4632.  
  4633.             Default:  -l option
  4634.  
  4635.             Usage:    mplist [ -adrel ] [ name=name ... ]
  4636.  
  4637.             Range:    n/a
  4638.  
  4639.             About:    The  mplist (mount-point  list)  command provides a
  4640.                       very  limited name  mapping facility.  For example,
  4641.                       you might map "/df1" to "df1:", so  that  a  refer-
  4642.                       ence to  the  file  "/df1/myfile" really references
  4643.                       "df1:myfile".
  4644.  
  4645.                       There are  currently many restrictions to this com-
  4646.                       mand, and it is  intended as only a stopgap measure
  4647.                       until  AmigaDos   supports  symbolic  links.    The
  4648.                       mplist  command will not  work  operate nicely with
  4649.                       file  completion,  and  the  entire  prefix must be
  4650.                       given for the mapping to take place.
  4651.  
  4652.                       Arguments  added  to  the  mplist are in  the  form
  4653.                       "name=name", where the first  name  is  the  source
  4654.                       for   the   mapping,   and   the   second  is   the
  4655.                       destination.   All   arguments must  be  single  or
  4656.                       double quoted.
  4657.  
  4658.                       -a   Add  the  supplied  arguments to  the  mplist.
  4659.                            The  old  contents of the  list  are  left  in
  4660.                            place.
  4661.  
  4662.                       -d   Delete   the   supplied   arguments  from  the
  4663.                            mplist.
  4664.  
  4665.                       -r   Synonym for -d.
  4666.  
  4667.                       -e   Empty the mplist.
  4668.  
  4669.                       -l   List the  contents of the mplist, one name per
  4670.                            line.  If no  command line switches are given,
  4671.                            this is the default.
  4672.  
  4673.             Hints:    Please note the following:
  4674.  
  4675.                       *    The  patterns  added  to  the  mplist must  be
  4676.                            single or double quoted.  
  4677.  
  4678.                       *    The first part  of  mplist entry (before the =
  4679.                            sign)  must  match  a  portion of  a  filename
  4680.                            exactly.
  4681.  
  4682.  
  4683.           SKsh Amiga Shell            Page 71             Reference Manual
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.                       *    The  mplist can be null if you don't  wish  to
  4695.                            use this feature.
  4696.  
  4697.  
  4698.             Example:  mplist -e     # empty the mplist
  4699.                       # now map /usr/df0 to df0:, and /ram to ram:
  4700.                       mplist -a '/usr/df0=df0:' '/ram=ram:'
  4701.  
  4702.             See Also:
  4703.  
  4704.           _________________________________________________________________
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.           SKsh Amiga Shell            Page 72             Reference Manual
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.           _________________________________________________________________
  4760.  
  4761.             Name:     mv
  4762.  
  4763.             Type:     Builtin
  4764.  
  4765.             Default:  n/a
  4766.  
  4767.             Usage:    mv [ -v ] source1 [ source2 ... ] destination
  4768.  
  4769.             Range:    n/a
  4770.  
  4771.             About:    mv  moves  files  or  directories by renaming them.
  4772.                       Thus,  it   cannot  be  used  to  move  data  cross
  4773.                       devices.  If more than one  source  is  given,  the
  4774.                       destination  must  be  a  directory or nonexistant.
  4775.                       If   it   is   nonexistant,  it  is  created  as  a
  4776.                       directory.
  4777.  
  4778.                       The  -v  option prints the name of each file as  it
  4779.                       is moved.
  4780.  
  4781.                       mv resets the archive bit of  all  files  which  it
  4782.                       moves.
  4783.  
  4784.             Example:  mv my_dir sys:another_dir/my_other_dir
  4785.  
  4786.             See Also: cp
  4787.  
  4788.           _________________________________________________________________
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.           SKsh Amiga Shell            Page 73             Reference Manual
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.           _________________________________________________________________
  4826.  
  4827.             Name:     OLDPWD
  4828.  
  4829.             Type:     Variable
  4830.  
  4831.             Default:  old present working directory string
  4832.  
  4833.             Usage:    $OLDPWD
  4834.  
  4835.             Range:    n/a
  4836.  
  4837.             About:    When  the  present  working  directory is  changed,
  4838.                       SKsh puts the old PWD value into OLDPWD.  The  cd -
  4839.                       p command can be used to return to OLDPWD.
  4840.  
  4841.             Example:  echo $PWD; cd c:; echo $OLDPWD
  4842.  
  4843.             See Also: PWD, pwd, cd
  4844.  
  4845.           _________________________________________________________________
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.           SKsh Amiga Shell            Page 74             Reference Manual
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.           _________________________________________________________________
  4892.  
  4893.             Name:     options
  4894.  
  4895.             Type:     Builtin
  4896.  
  4897.             Default:  n/a
  4898.  
  4899.             Usage:    options [ -opts | +opts ] ...
  4900.  
  4901.             Range:    n/a
  4902.  
  4903.             About:    The  options  command  provides a way to change the
  4904.                       default  behavior of SKsh in a number of areas.  If
  4905.                       the  command is  entered with no parameters, simply
  4906.                       prints  the  current options string, which is a se-
  4907.                       ries  of  letters and digits.   Otherwise, it exam-
  4908.                       ines  each  parameter in turn.  Each  parameter can
  4909.                       begin with a '+' or '-'; a '+' turns "on"  the  op-
  4910.                       tions  corresponding  each  letter, and a '-' turns
  4911.                       them "off".
  4912.  
  4913.                       +1   Set  the  overstrike/insert mode back  to  the
  4914.                            default  value  after a return.  If this  flag
  4915.                            is  not  set,  the  overstrike/insert mode re-
  4916.                            mains set to what it was previously.
  4917.  
  4918.                       +c   If  set,  SKsh  wildcard  expansion,  filename
  4919.                            completion, and a few other features  will  be
  4920.                            case independent.   If  unset,  they  will  be
  4921.                            case dependent.
  4922.  
  4923.                       +e   If  set,  disable  command line editing.  This
  4924.                            might  be  useful for using SKsh from a termi-
  4925.                            nal that does not  support the ANSI escape se-
  4926.                            quences SKsh  uses  for  line  editing.   Note
  4927.                            that is flag is SET in  .skshinit.   You  must
  4928.                            reset it in .skshrc if you wish  to  use  line
  4929.                            editing (the .skshrc  file  supplied with SKsh
  4930.                            does this).
  4931.  
  4932.                       +f   If set, disable wildcard filename expansion.
  4933.  
  4934.                       +h   If  set,  always  create a  new  history line,
  4935.                            even  if  an  old  command  was  executed with
  4936.                            'history  -e'  or   the   interactive  editing
  4937.                            facility.   If  not  set,  executing old lines
  4938.                            will not create a new history entry.
  4939.  
  4940.                       +i   If set, use IFS to split $( )  command substi-
  4941.                            tution text, much  as  it  is  used  to  split
  4942.                            variable value expansion text.
  4943.  
  4944.                       +l   If  set,  variables referenced in functions or
  4945.  
  4946.  
  4947.           SKsh Amiga Shell            Page 75             Reference Manual
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.                            parenthetical  subshells  will  be  local (al-
  4958.                            though this  also  depends on the 'n' option).
  4959.                            If not set, there will be no  local variables.
  4960.                            Note  that  resetting this flag may have large
  4961.                            side   effects   when   running  scripts   and
  4962.                            functions.   The   advantage is that it  takes
  4963.                            less memory and is faster.
  4964.  
  4965.                       +n   If set, only read scripts, but do not  execute
  4966.                            their commands.  This is  ignored for interac-
  4967.                            tive use.
  4968.  
  4969.                       +p   If set,  use  the  exec  prompt  string  mode.
  4970.                            This tells sksh not to use the  prompt  string
  4971.                            as the prompt  directly, but rather to pass it
  4972.                            through  the  command  interpreter first,  and
  4973.                            use  the  results  as  the  prompt.   This  is
  4974.                            slower, but more powerful.
  4975.  
  4976.                       +s   If   set,   sort   filename   parameters  from
  4977.                            wildcard expansion.
  4978.  
  4979.                       +v   If  set,  variable  expansions  which  contain
  4980.                            wildcard  characters will use  those  wildcard
  4981.                            characters  in  filename  matching.   For  ex-
  4982.                            ample,  if  the  "foo"  variable contains "*",
  4983.                            then "echo $foo.bar" would echo any file  name
  4984.                            ending with ".bar".  If the v flag  is  RESET,
  4985.                            then  it  would  simply echo "*.bar"; ie,  the
  4986.                            value  of  the  variable would be  substituted
  4987.                            but ignored for filename matching.
  4988.  
  4989.                       +w   If set, SKsh will  use  the  dwclist to selec-
  4990.                            tively  bypass  wildcard  file  expansion on a
  4991.                            command  by  command basis.   It  is  reset by
  4992.                            default.
  4993.  
  4994.                       +x   If set, print each lines as  it  is  executed.
  4995.                            Moderately useful for debugging scripts.
  4996.  
  4997.                       +C   Enable the  internal completion list.  See the
  4998.                            complist  command for details.  If  reset, the
  4999.                            internal completion list will be ignored.
  5000.  
  5001.                       +F   If set, map UNIX style filenames  to  AmigaDos
  5002.                            style  file  names.   A  leading '/' becomes a
  5003.                            ':',  a  '~'  inserts the contents of the HOME
  5004.                            variable,  a  '.'  becomes the  current direc-
  5005.                            tory, and two dots become a slash.
  5006.  
  5007.                       +H   If set, lines executed with  history  -e  will
  5008.                            be printed before they are executed.
  5009.  
  5010.  
  5011.  
  5012.  
  5013.           SKsh Amiga Shell            Page 76             Reference Manual
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.                       +I   If set, leave out the .info files from  direc-
  5024.                            tory  listings  unless the 'i'  option to 'ls'
  5025.                            is explicitly set.
  5026.  
  5027.                       +N   Create  new  variables in a  subshell or func-
  5028.                            tion  only  if  a  variable with the same name
  5029.                            does  not  exist in an outer context.  If  one
  5030.                            does  exist, that one will be used  instead of
  5031.                            making  a  new  local  variable.   This   flag
  5032.                            changes the scoping  rules,  and  can  have  a
  5033.                            large  effect in the  execution of scripts and
  5034.                            functions; it should be used with care.
  5035.  
  5036.                       +O   Use  overstrike  instead of insert mode as the
  5037.                            default for command line editing.
  5038.  
  5039.                       +P   If set,  ^r  history searches and 'history -e'
  5040.                            style  history  access will only  match  lines
  5041.                            beginning with the given  string.   If  unset,
  5042.                            the string  can  match  any  location within a
  5043.                            history line.
  5044.  
  5045.                       +R   Disable  automatic  setting of LINES and  COL-
  5046.                            UMNS  variables.    Normally, these  variables
  5047.                            are  set  after the  window is re-sized at the
  5048.                            next  interactive prompt.  To set  them  manu-
  5049.                            ally and not  be  overridden by SKsh, use this
  5050.                            options flag.
  5051.  
  5052.                       +S   Insert a single  blank  line  before and after
  5053.                            the     prompt     when     typing    commands
  5054.                            interactively.   For   interlace screens where
  5055.                            more than 36 or so lines are  displayed, using
  5056.                            the  S  option can  create a more visually ap-
  5057.                            pealing and "tidy" display.
  5058.  
  5059.                       +U   The  U  option, if set, causes SKsh to  use  a
  5060.                            requester if a  component of the path contains
  5061.                            an  unmounted volume.  This also  affects sev-
  5062.                            eral  other  areas,  such  as  the  '-m'  test
  5063.                            expression.
  5064.  
  5065.  
  5066.             Example:  # see which options are turned on:
  5067.                       options
  5068.                       # reset all options:
  5069.                       options $(echo -c - '-' $(options))
  5070.  
  5071.             See Also:
  5072.  
  5073.           _________________________________________________________________
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.           SKsh Amiga Shell            Page 77             Reference Manual
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.           _________________________________________________________________
  5090.  
  5091.             Name:     PATH
  5092.  
  5093.             Type:     Variable
  5094.  
  5095.             Default:  '.,c:'
  5096.  
  5097.             Usage:    $PATH
  5098.  
  5099.             Range:    n/a
  5100.  
  5101.             About:    This  variable  contains a comma  separated list of
  5102.                       directory  names.   When  SKsh  executes a file, it
  5103.                       searches for it in these  directories.   Note  that
  5104.                       the  current  working  directory must be  specified
  5105.                       explicitly (".").  This lets you change  the  order
  5106.                       of the search.  For  example, you could move "." to
  5107.                       the end of the path to search it last.  The  direc-
  5108.                       tory names in the path do not  need  to  be  termi-
  5109.                       nated by a slash; SKsh will add one if  it  is  not
  5110.                       there.
  5111.  
  5112.                       If SKsh finds the file name  in  the  search  path,
  5113.                       and the file has its script bit set, SKsh will  at-
  5114.                       tempt  to  execute this file as a script instead of
  5115.                       a binary.
  5116.  
  5117.                       The  PATH  variable is also used by  the  which and
  5118.                       whence commands.
  5119.  
  5120.                       Entries in the  path  which  are  on  currently un-
  5121.                       mounted  devices  are  bypassed silently,  although
  5122.                       this behavior  can  be  changed  with  the  options
  5123.                       command.
  5124.  
  5125.             Example:  c:run $(which emacs) my_file
  5126.  
  5127.             See Also: path, which, whence
  5128.  
  5129.           _________________________________________________________________
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.           SKsh Amiga Shell            Page 78             Reference Manual
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.           _________________________________________________________________
  5156.  
  5157.             Name:     path
  5158.  
  5159.             Type:     Function
  5160.  
  5161.             Default:  see the .skshinit file
  5162.  
  5163.             Usage:    path
  5164.                       path name
  5165.                       path -add [ name ... ]
  5166.  
  5167.             Range:    n/a
  5168.  
  5169.             About:    This  function  is  provided to make the PATH vari-
  5170.                       able easier to set up and manipulate.
  5171.  
  5172.                       With  no  arguments, path simply prints the current
  5173.                       path definition.
  5174.  
  5175.                       The  second form above sets  the  path  variable to
  5176.                       name.
  5177.  
  5178.                       The third form above adds each  name  to  the  path
  5179.                       variable  list,  provided  that  it  is  not  there
  5180.                       already.  If  the  name  is  already a component of
  5181.                       the path, it is ignored.
  5182.  
  5183.             Example:  path -add sys:bin sys:pd/bin
  5184.  
  5185.             See Also: PATH
  5186.  
  5187.           _________________________________________________________________
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.           SKsh Amiga Shell            Page 79             Reference Manual
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.           _________________________________________________________________
  5222.  
  5223.             Name:     PNPC
  5224.  
  5225.             Type:     Variable
  5226.  
  5227.             Default:  21
  5228.  
  5229.             Usage:    $PNPC
  5230.  
  5231.             Range:    0 to 63
  5232.  
  5233.             About:    This  variable is  one  of  several responsible for
  5234.                       controlling  the  actions of SKsh line  editing and
  5235.                       display output.  PNPC  tells  SKsh  how  many  non-
  5236.                       printing  control  characters there are in the cur-
  5237.                       rently  defined prompt strings (both PS1 and  PS2).
  5238.                       SKsh needs to know this so that  it  can  find  the
  5239.                       actual  printing width of the  prompt  string  from
  5240.                       the  actual  character length.  You will only  have
  5241.                       to change PNPC if  you  change  the  number of ANSI
  5242.                       control sequences in your prompt.
  5243.  
  5244.             Example:  PNPC=0
  5245.  
  5246.             See Also: COLUMNS, PS1, PS2, options
  5247.  
  5248.           _________________________________________________________________
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.           SKsh Amiga Shell            Page 80             Reference Manual
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.           _________________________________________________________________
  5288.  
  5289.             Name:     preparse
  5290.  
  5291.             Type:     Builtin
  5292.  
  5293.             Default:  n/a
  5294.  
  5295.             Usage:    preparse < infile > outfile
  5296.  
  5297.             Range:    n/a
  5298.  
  5299.             About:    preparse reads  a  legal SKsh script from its stan-
  5300.                       dard  input and  produces a "preparsed" file on its
  5301.                       standard output.  This preparsed file can  then  be
  5302.                       read back into SKsh much  (2  to  3  times)  faster
  5303.                       than  a  normal SKsh script  file.   The  preparsed
  5304.                       file acts just like a script file; if  it  has  its
  5305.                       script bit set, it  can  be  automatically executed
  5306.                       by  typing its name.  It can also be sourced.  How-
  5307.                       ever, it is not in a human readable format.
  5308.  
  5309.                       SKsh  guarantees that script files will be upwardly
  5310.                       compatible   between  versions  of  SKsh;  however,
  5311.                       preparsed  files  will  not  be.    Therefore,  the
  5312.                       source scripts must be retained.
  5313.  
  5314.                       SKsh  will  automatically detect preparsed versions
  5315.                       of  the  .skshinit  and   .skshrc   files   (called
  5316.                       .skshinit.pp and .skshrc.pp) and use those if  they
  5317.                       exist.  This  can  dramatically reduce SKsh invoca-
  5318.                       tion time.
  5319.  
  5320.                       SKsh will  issue an error message if you try to ex-
  5321.                       ecute a  preparsed  file  from  an  old  version of
  5322.                       SKsh.
  5323.  
  5324.                       Preparsing files  will  probably make a significant
  5325.                       difference only if the file is later  read  from  a
  5326.                       hard disk or a ram drive.  From a floppy, SKsh  can
  5327.                       parse the file nearly as fast  as  the  floppy  can
  5328.                       read it.
  5329.  
  5330.             Example:  preparse < Stuff.sksh > Stuff.sksh.pp
  5331.  
  5332.             See Also: Addendum1.5.doc for an example  of  how  to  source
  5333.                       other preparesed files from your .skshrc file.
  5334.  
  5335.           _________________________________________________________________
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.           SKsh Amiga Shell            Page 81             Reference Manual
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.           _________________________________________________________________
  5354.  
  5355.             Name:     printf
  5356.  
  5357.             Type:     Builtin
  5358.  
  5359.             Default:  n/a
  5360.  
  5361.             Usage:    printf formatstring parameters...
  5362.  
  5363.             Range:    n/a
  5364.  
  5365.             About:    printf  is  similar to the  C  function of the same
  5366.                       name.  The  first  parameters is the format string,
  5367.                       and  the  rest  are  inserted appropriately.   Note
  5368.                       that there  are  no  associated fprintf and sprintf
  5369.                       functions,  as  those  can  be  easily accomplished
  5370.                       with "var=$(printf)" or "printf >>file".
  5371.  
  5372.                       The  echo  statement should be used when no format-
  5373.                       ting is needed.
  5374.  
  5375.             Notes:    To print  integers, "%ld" should always be used in-
  5376.                       stead of "%d".
  5377.  
  5378.                       The  "%c"  option does not  work.   Instead, use %s
  5379.                       with a one character string.
  5380.  
  5381.                       Any  argument beginning with "-" or a digit will be
  5382.                       converted to a 32  bit  integer before being passed
  5383.                       to printf.   This  is  necessary as SKsh stores all
  5384.                       values  internally as strings.  If you wish to  use
  5385.                       such  a  parameter with the "%s"  format, prefix it
  5386.                       with a leading space.
  5387.  
  5388.                       The  result string must fit within one  SKsh  token
  5389.                       (1023  characters).  SKsh does not check for  over-
  5390.                       flow, so it would be advisable to heed this limit.
  5391.  
  5392.             Example:  printf "Test: %10s %5ld" FOO 42
  5393.  
  5394.             See Also: echo
  5395.  
  5396.           _________________________________________________________________
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.           SKsh Amiga Shell            Page 82             Reference Manual
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.           _________________________________________________________________
  5420.  
  5421.             Name:     ps
  5422.  
  5423.             Type:     Builtin
  5424.  
  5425.             Default:  n/a
  5426.  
  5427.             Usage:    ps
  5428.  
  5429.             Range:    n/a
  5430.  
  5431.             About:    ps prints, for each  CLI  process, the process num-
  5432.                       ber,  the  address of the  process, the priority of
  5433.                       the  process, the  command name associated with the
  5434.                       process, and the  current working directory for the
  5435.                       process.
  5436.  
  5437.             Example:  ps
  5438.  
  5439.             See Also:
  5440.  
  5441.           _________________________________________________________________
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.           SKsh Amiga Shell            Page 83             Reference Manual
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.           _________________________________________________________________
  5486.  
  5487.             Name:     PS1
  5488.  
  5489.             Type:     Variable
  5490.  
  5491.             Default:  '$_ANSI_P3[$PWD]: $_ANSI_P1'
  5492.  
  5493.             Usage:    $PS1
  5494.  
  5495.             Range:    n/a
  5496.  
  5497.             About:    This  variable  controls the  primary prompt string
  5498.                       displayed by SKsh.  If the 'p'  SKsh  option is not
  5499.                       set  (see  options), SKsh  expands the variables in
  5500.                       the string,  and  outputs it as the primary prompt.
  5501.                       For this  reason, PS1 should be defined to a single
  5502.                       quoted string, so that  the  variables are expanded
  5503.                       at the proper time and not when PS1 is defined.
  5504.  
  5505.                       If  the  'p'  option to SKsh is set, SKsh sends the
  5506.                       contents of  the  PS1  variable through the command
  5507.                       interpreter,  and  displays the  result as the pri-
  5508.                       mary prompt.  In this case,  PS1  should  contain a
  5509.                       string which when  executed, will print the desired
  5510.                       prompt.  This is  slower  than  the  default method
  5511.                       above.
  5512.  
  5513.             Example:  PS1='$ '; PNPC=0
  5514.  
  5515.             See Also: PS2, PNPC, options
  5516.  
  5517.           _________________________________________________________________
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.           SKsh Amiga Shell            Page 84             Reference Manual
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.           _________________________________________________________________
  5552.  
  5553.             Name:     PS2
  5554.  
  5555.             Type:     Variable
  5556.  
  5557.             Default:  '$_ANSI_P3> $_ANSI_P1'
  5558.  
  5559.             Usage:    $PS2
  5560.  
  5561.             Range:    n/a
  5562.  
  5563.             About:    This  variable controls the secondary prompt string
  5564.                       displayed by SKsh.  This is the prompt string  dis-
  5565.                       played  when  SKsh  expects more input, such as the
  5566.                       continuation  of  a  for  statement or unterminated
  5567.                       string.
  5568.  
  5569.                       If the  'p'  SKsh  option is not set (see options),
  5570.                       SKsh  expands the variables in the string, and out-
  5571.                       puts it as the  secondary prompt.  For this reason,
  5572.                       PS2  should  be  defined to a single quoted string,
  5573.                       so  that  the  variables are expanded at the proper
  5574.                       time and not when PS2 is defined.
  5575.  
  5576.                       If  the  'p'  option to SKsh is set, SKsh sends the
  5577.                       contents of  the  PS2  variable through the command
  5578.                       interpreter,  and  displays the  result as the sec-
  5579.                       ondary prompt.  In this case, PS2 should  contain a
  5580.                       string which when  executed, will print the desired
  5581.                       prompt.  This is  slower  than  the  default method
  5582.                       above.
  5583.  
  5584.             Example:  PS2=': '; PNPC=0
  5585.  
  5586.             See Also: PS1, PNPC, options
  5587.  
  5588.           _________________________________________________________________
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.           SKsh Amiga Shell            Page 85             Reference Manual
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.           _________________________________________________________________
  5618.  
  5619.             Name:     PWD
  5620.  
  5621.             Type:     Variable
  5622.  
  5623.             Default:  present working directory string
  5624.  
  5625.             Usage:    $PWD
  5626.  
  5627.             Range:    n/a
  5628.  
  5629.             About:    SKsh  maintains the  contents of this variable such
  5630.                       that  it  always  represents  the  current  working
  5631.                       directory.
  5632.  
  5633.             Example:  old_dir="$PWD";    # save old directory
  5634.  
  5635.             See Also: OLDPWD, pwd, cd
  5636.  
  5637.           _________________________________________________________________
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.  
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.           SKsh Amiga Shell            Page 86             Reference Manual
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.           _________________________________________________________________
  5684.  
  5685.             Name:     pwd
  5686.  
  5687.             Type:     Alias
  5688.  
  5689.             Default:  echo "$PWD"
  5690.  
  5691.             Usage:    pwd
  5692.  
  5693.             Range:    n/a
  5694.  
  5695.             About:    This  alias  simply prints the present  working di-
  5696.                       rectory string.
  5697.  
  5698.             Example:  pwd
  5699.  
  5700.             See Also: PWD, OLDPWD
  5701.  
  5702.           _________________________________________________________________
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.           SKsh Amiga Shell            Page 87             Reference Manual
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.           _________________________________________________________________
  5750.  
  5751.             Name:     quit
  5752.  
  5753.             Type:     Alias
  5754.  
  5755.             Default:  LOGOUT=""; exit
  5756.  
  5757.             Usage:    pwd
  5758.  
  5759.             Range:    n/a
  5760.  
  5761.             About:    quit  is  like  exit but does not execute the value
  5762.                       of the LOGOUT variable first.
  5763.  
  5764.             Example:  pwd
  5765.  
  5766.             See Also: exit, logout, LOGOUT
  5767.  
  5768.           _________________________________________________________________
  5769.  
  5770.  
  5771.  
  5772.  
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.           SKsh Amiga Shell            Page 88             Reference Manual
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.           _________________________________________________________________
  5816.  
  5817.             Name:     read
  5818.  
  5819.             Type:     Builtin
  5820.  
  5821.             Default:  n/a
  5822.  
  5823.             Usage:    read var
  5824.  
  5825.             Range:    n/a
  5826.  
  5827.             About:    The  read command sets the value of the variable by
  5828.                       reading  exactly  one  command  from  the  standard
  5829.                       input.  This can be used  to  accept input from the
  5830.                       keyboard, or it can  have  its  own  standard input
  5831.                       redirected to read lines from  a  file.   Read  re-
  5832.                       turns a non-zero  return code when it encounters an
  5833.                       end-of-file; this is useful in loops.
  5834.  
  5835.             Example:  while read in_line
  5836.                       do
  5837.                          echo "We read: $in_line"
  5838.                       done < my_input_file.txt
  5839.  
  5840.             See Also:
  5841.  
  5842.           _________________________________________________________________
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.           SKsh Amiga Shell            Page 89             Reference Manual
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.           _________________________________________________________________
  5882.  
  5883.             Name:     resident
  5884.  
  5885.             Type:     Builtin
  5886.  
  5887.             Default:  n/a
  5888.  
  5889.             Usage:    resident [ -l ]
  5890.                       resident [ -a | -d ] [ progname ... ]
  5891.  
  5892.             Range:    n/a
  5893.  
  5894.             About:    The  resident  command can be used  to  examine the
  5895.                       resident list,  add  programs to it, or delete pro-
  5896.                       grams  from  it.    "resident" with no arguments or
  5897.                       with the "-l" flag lists the  programs currently on
  5898.                       the  resident list.  The -a  flag  adds  the  named
  5899.                       programs  to  the  resident list; the whole path to
  5900.                       the file must be given,  although only the basename
  5901.                       is  remembered.   Resident -d deletes programs from
  5902.                       the resident list.
  5903.  
  5904.             Example:  resident -a /bin/view   # add view to res list
  5905.                       resident -l             # list resident list
  5906.  
  5907.             See Also: which
  5908.  
  5909.           _________________________________________________________________
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.           SKsh Amiga Shell            Page 90             Reference Manual
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.           _________________________________________________________________
  5948.  
  5949.             Name:     return
  5950.  
  5951.             Type:     Builtin
  5952.  
  5953.             Default:  n/a
  5954.  
  5955.             Usage:    return [ num ]
  5956.  
  5957.             Range:    n/a
  5958.  
  5959.             About:    The  return command exits from an enclosing script,
  5960.                       subshell, or function.  If  given  a  numeric argu-
  5961.                       ment, it  exits from the nth enclosing script, sub-
  5962.                       shell, or function.
  5963.  
  5964.             Example:  ( echo foo; return; echo 'This is not echoed' )
  5965.  
  5966.             See Also: continue, break
  5967.  
  5968.           _________________________________________________________________
  5969.  
  5970.  
  5971.  
  5972.  
  5973.  
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.           SKsh Amiga Shell            Page 91             Reference Manual
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.           _________________________________________________________________
  6014.  
  6015.             Name:     rm
  6016.  
  6017.             Type:     Builtin
  6018.  
  6019.             Default:  n/a
  6020.  
  6021.             Usage:    rm [ -rvf ] [ file | dir ] ...
  6022.  
  6023.             Range:    n/a
  6024.  
  6025.             About:    This  command  simply  removes the named files.  It
  6026.                       will  not  remove  directories unless the '-r' flag
  6027.                       is  used;  use  rmdir  to  remove a  single,  empty
  6028.                       directory.
  6029.  
  6030.                       The '-r' flag  causes  'rm'  to  recursively remove
  6031.                       everything  under each directory.  This is somewhat
  6032.                       dangerous; care should be used.
  6033.  
  6034.                       The '-v' flag prints the name of each  file  as  it
  6035.                       is removed.
  6036.  
  6037.                       The '-f' flag will perform a "chmod  +wd"  on  each
  6038.                       file or directory before deletion.
  6039.  
  6040.             Example:  rm scrap_file.c
  6041.  
  6042.             See Also: rmdir
  6043.  
  6044.           _________________________________________________________________
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.           SKsh Amiga Shell            Page 92             Reference Manual
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.           _________________________________________________________________
  6080.  
  6081.             Name:     rmdir
  6082.  
  6083.             Type:     Builtin
  6084.  
  6085.             Default:  n/a
  6086.  
  6087.             Usage:    rmdir [ dir ... ]
  6088.  
  6089.             Range:    n/a
  6090.  
  6091.             About:    This  command simply removes the named directories.
  6092.                       It will  not  remove files or directories which are
  6093.                       not empty.
  6094.  
  6095.             Example:  rmdir scrap_dir
  6096.  
  6097.             See Also: rmdir
  6098.  
  6099.           _________________________________________________________________
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.           SKsh Amiga Shell            Page 93             Reference Manual
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.           _________________________________________________________________
  6146.  
  6147.             Name:     ROOT
  6148.  
  6149.             Type:     Variable
  6150.  
  6151.             Default:  ":"
  6152.  
  6153.             Usage:    path names beginning with '/'
  6154.  
  6155.             Range:    Any legal directory or filesystem device name
  6156.  
  6157.             About:    When  Un*x  filename  mapping is used (see the  op-
  6158.                       tions  command), SKsh replaces a leading slash with
  6159.                       the  contents of this variable.  It  is  normally a
  6160.                       colon, which makes the  path  name  become relative
  6161.                       to the "root" of  the  current device.  However, it
  6162.                       can be set  to  any  directory or filesystem device
  6163.                       name.   For   example, if set to "sys:",  all  file
  6164.                       references  beginning  with  a  slash  will  become
  6165.                       relative to 'sys:',  even  if  the  current working
  6166.                       directory  is  on  another device.  If can also  be
  6167.                       set to a subdirectory  of  a  device, as in the ex-
  6168.                       ample  below, in which case  it  must  end  with  a
  6169.                       slash.
  6170.  
  6171.             Example:  ROOT=sys:usr/work/    # make this the new "root"
  6172.  
  6173.             See Also: options
  6174.  
  6175.           _________________________________________________________________
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.           SKsh Amiga Shell            Page 94             Reference Manual
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.           _________________________________________________________________
  6212.  
  6213.             Name:     set
  6214.  
  6215.             Type:     Builtin
  6216.  
  6217.             Default:  n/a
  6218.  
  6219.             Usage:    set [ -fabvs ] [ pattern ... ]
  6220.  
  6221.             Range:    n/a
  6222.  
  6223.             About:    With  no  options,  set lists each variable and its
  6224.                       definition.   If   pattern  arguments, each one  is
  6225.                       listed.  The  'f'  options forces interpretation as
  6226.                       function names, the 'a'  option as alias names, the
  6227.                       'b'  option  as  builtin command names, and the 'v'
  6228.                       option as variables names (the default).
  6229.  
  6230.                       The 's'  option leaves out the definition, printing
  6231.                       only the name on  a  single  line.   In  any  case,
  6232.                       function  definitions are not listed in  this  ver-
  6233.                       sion of SKsh.  If the  's'  option is used, the 'v'
  6234.                       option  must  explicitly be set to list  variables.
  6235.                       Also, more than one of 'f', 'a', 'b', and  'v'  may
  6236.                       be set.
  6237.  
  6238.                       SKsh will not  list  any  function, alias, builtin,
  6239.                       or  variable whose  name  begins with an underscore
  6240.                       (hidden  variables, etc).  This is useful to either
  6241.                       hide  definitions  from  users, or in  cases  where
  6242.                       printing  the  contents of a variable would corrupt
  6243.                       the display (such as the _ANSI_CLEAR variable).
  6244.  
  6245.                       The  definition of builtin commands is printed as a
  6246.                       short description of the command.
  6247.  
  6248.                       The  set  command  cannot be used to set variables,
  6249.                       as  in  csh.  Use the assignment operator ('=') for
  6250.                       that.
  6251.  
  6252.             Example:  set -b '[a-d]*'
  6253.  
  6254.             See Also: unset
  6255.  
  6256.           _________________________________________________________________
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.           SKsh Amiga Shell            Page 95             Reference Manual
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.           _________________________________________________________________
  6278.  
  6279.             Name:     setmap
  6280.  
  6281.             Type:     Builtin
  6282.  
  6283.             Default:  n/a
  6284.  
  6285.             Usage:    setmap -r
  6286.                       setmap -s map [{key|code} {fn|"@map"|"!macro"}]...
  6287.                       setmap -n mapnum ...
  6288.                       setmap -e exitmap mapnum ...
  6289.                       setmap -m macronum [ fn | string ] ...
  6290.  
  6291.             Range:    32 definable key maps ( 0 to 31)
  6292.                       256 entries per key map
  6293.                       32 definable key macros ( 0 to 31 )
  6294.                       64 byte maximum key macro size
  6295.  
  6296.             About:    The  setmap command is used to define SKsh keyboard
  6297.                       editing maps.   SKsh  is  capable of emulating most
  6298.                       popular  editor styles to a reasonable degree.  The
  6299.                       UserMan.doc  file  discusses the theory of SKsh key
  6300.                       maps in greater  detail; this is just intended as a
  6301.                       reference guide.  Pleas read that section as well.
  6302.  
  6303.                       "setmap  -r"  resets all keymaps and key  macros to
  6304.                       their default (dumb) state.
  6305.  
  6306.                       "setmap" alone or with an  optional -s flag is used
  6307.                       to set keymaps.  The first  argument is integer be-
  6308.                       tween  0  and  31  indicating the keymap to change.
  6309.                       All  subsequent arguments are grouped in pairs; the
  6310.                       first of the pair is  a  character (such as "A") or
  6311.                       an ascii code  (such  as  08).   The  second of the
  6312.                       pair is one of:
  6313.  
  6314.                          1) a  function name (such as  "DEL").   In  this
  6315.                             case  the  function will be executed when the
  6316.                             key is pressed.
  6317.  
  6318.                          2) another  keymap  number  prefixed by '@'.  In
  6319.                             this  case  the  new  keymap will  become the
  6320.                             current keymap when the key is pressed.
  6321.  
  6322.                          3) a  macro  number  prefixed by '!'.   In  this
  6323.                             case the macro will be  executed when the key
  6324.                             is pressed.
  6325.  
  6326.                       "setmap -n" sets  the  keymaps  to  be  non-exiting
  6327.                       keymaps.  In other  words,  after a function is ex-
  6328.                       ecuted  in  the  current keymap it remains the cur-
  6329.                       rent keymap.
  6330.  
  6331.  
  6332.  
  6333.           SKsh Amiga Shell            Page 96             Reference Manual
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.                       "setmap  -e"  sets  the  keymaps  to  be  "exiting"
  6344.                       keymaps which  exit  to  keymap "exitmap" after one
  6345.                       function.
  6346.  
  6347.                       "setmap -m"  defines a numbered macro (macronum) to
  6348.                       be a series of functions or strings.
  6349.  
  6350.  
  6351.             Notes:    The following are legal keymap functions when  used
  6352.                       with "setmap -s" or "setmap -m"
  6353.  
  6354.                          INS    - insert typed character
  6355.                          NOP    -  perform no operation
  6356.                          ACC    - "accept" and execute line
  6357.                          REP    - set repeat count
  6358.                          FNK    - execute function key
  6359.                          BS     - backspace
  6360.                          BOL    - move to beginning of line
  6361.                          ZAP    - delete all of current line
  6362.                          DEL    - delete one character forward
  6363.                          EOL    - move to end of line
  6364.                          RHT    - move cursor right one character
  6365.                          LFT    - move cursor left one character
  6366.                          KEL    - kill to end of the line
  6367.                          UP     - move to previous history line
  6368.                          DN     - move to next history line
  6369.                          EXE    - "execute" line and move to next
  6370.                          FWW    - move forward one word
  6371.                          BKW    - move backward one word
  6372.                          BDW    - backward delete word (before cursor)
  6373.                          DLW    - delete word (in front of cursor)
  6374.                          SRH    - search for text in history list
  6375.                          CC1    - command completion type 1 (esc esc)
  6376.                          CC2    - command completion type 2 (esc =)
  6377.                          CC3    - command completion type 3 (esc *)
  6378.                          HOL    - head of list (first history line)
  6379.                          TOL    - tail of list (last history line)
  6380.                          ILP    - insert last parameter of previous line
  6381.                          ILT    - insert tail of previous line
  6382.                          TIM    - toggle insert mode
  6383.                          RDL    - redraw current line
  6384.                          SPC    - switch two previous characters
  6385.                          ISM    - change to insert mode (from any mode)
  6386.                          OVS    - change to overstrike mode
  6387.                          PIO    - change to previous insert/overstrike
  6388.                          YNK    - insert text from yank buffer
  6389.                          CEL    - copy text to EOL into yank buffer
  6390.                          ERC    - explicitly set repeat count
  6391.                          GK0    - goto keymap 0 (for use in macros)
  6392.                          GK1    - goto keymap 1 (for use in macros)
  6393.                          GK2    - goto keymap 2 (for use in macros)
  6394.                          GK3    - goto keymap 3 (for use in macros)
  6395.                          GK4    - goto keymap 4 (for use in macros)
  6396.  
  6397.  
  6398.  
  6399.           SKsh Amiga Shell            Page 97             Reference Manual
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.             Example:  # reset all keymaps
  6410.                       setmap -r
  6411.  
  6412.                       # set keymaps 1 and 3 to be non-exiting
  6413.                       setmap -n 1 3
  6414.  
  6415.                       # set keymaps 2 and 4 to exit to keymap number 1
  6416.                       setmap -e 1  2 4
  6417.  
  6418.                       # set macro number 0 to move to the beginning of
  6419.                       # the line, insert a '#', and accept the line
  6420.                       setmap -m 0  BOL '#' ACC
  6421.  
  6422.                       # set the "esc" key to move to keymap 1, the "del"
  6423.                       # key to delete a character, and the "~" key to
  6424.                       # execute macro number 5
  6425.                       setmap -s 0   27 @1  04 DEL  '~' '!5'
  6426.  
  6427.             See Also: UserMan.doc:
  6428.                       Advanced Topics: Definable Keyboard Editing
  6429.  
  6430.           _________________________________________________________________
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.           SKsh Amiga Shell            Page 98             Reference Manual
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.           _________________________________________________________________
  6476.  
  6477.             Name:     SHELL
  6478.  
  6479.             Type:     Variable
  6480.  
  6481.             Default:  sksh
  6482.  
  6483.             Usage:    $SHELL
  6484.  
  6485.             Range:    n/a
  6486.  
  6487.             About:    This  variable is set by SKsh to the string "sksh".
  6488.                       It can be used to  test  which  shell  is  running,
  6489.                       provided  that  the  alternate shell has a  similar
  6490.                       syntax.
  6491.  
  6492.             Example:  if [ "$SHELL" != 'sksh' ]
  6493.                       then
  6494.                           echo "This runs only under SKsh!"
  6495.                       fi
  6496.  
  6497.             See Also: SYSNAME
  6498.  
  6499.           _________________________________________________________________
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.           SKsh Amiga Shell            Page 99             Reference Manual
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.           _________________________________________________________________
  6542.  
  6543.             Name:     shift
  6544.  
  6545.             Type:     Builtin
  6546.  
  6547.             Default:  n/a
  6548.  
  6549.             Usage:    shift [ num ]
  6550.  
  6551.             Range:    n/a
  6552.  
  6553.             About:    This  command  is  used  inside of scripts or func-
  6554.                       tions to shift  the  parametric arguments.  For ex-
  6555.                       ample, if $1  =  'foo'  and  $2  =  'bar',  after a
  6556.                       shift, $1 would be 'bar' and $2 would not  be  set.
  6557.                       The  '$#'  and  '$*'  variables are  also  modified
  6558.                       appropriately.  If shift is given a  numeric param-
  6559.                       eter, it  acts  as  though  num  consecutive shifts
  6560.                       took place.
  6561.  
  6562.             Example:  function my_func {
  6563.                          echo "$2, $#"
  6564.                          shift
  6565.                          echo "$2, $#"
  6566.                       }
  6567.  
  6568.             See Also: function
  6569.  
  6570.           _________________________________________________________________
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.           SKsh Amiga Shell            Page 100            Reference Manual
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.           _________________________________________________________________
  6608.  
  6609.             Name:     SIZE
  6610.  
  6611.             Type:     Variable
  6612.  
  6613.             Default:  "normal" for plain SKsh
  6614.                       "tiny" for tiny_SKsh
  6615.  
  6616.             Usage:    $SIZE
  6617.  
  6618.             Range:    n/a
  6619.  
  6620.             About:    This  variable can be used to test the shell under which a
  6621.                       script or function is being run.
  6622.  
  6623.             Example:  if [ "$SIZE" = 'normal' ]
  6624.                       then
  6625.                          echo 'This is normal SKsh'
  6626.                       else
  6627.                          echo 'This is tiny_SKsh'
  6628.                       fi
  6629.  
  6630.             See Also:
  6631.  
  6632.           _________________________________________________________________
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.           SKsh Amiga Shell            Page 101            Reference Manual
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.           _________________________________________________________________
  6674.  
  6675.             Name:     sleep
  6676.  
  6677.             Type:     Builtin
  6678.  
  6679.             Default:  n/a
  6680.  
  6681.             Usage:    sleep n
  6682.  
  6683.             Range:    n/a
  6684.  
  6685.             About:    Sleep  delays  execution  for  n seconds.  If  n is
  6686.                       omitted,  zero,  or  negative, the command does not
  6687.                       pause.   Sleep  takes   virtually no CPU time.   It
  6688.                       will  wake  up  once  per  second to check for  the
  6689.                       break key.  Sleep is  not  guaranteed to be a delay
  6690.                       of  exactly  n  seconds; it may be more on a loaded
  6691.                       system, or if SKsh is  preempted by a higher prior-
  6692.                       ity process.   It  is,  however, guaranteed to be a
  6693.                       delay of at least n seconds.
  6694.  
  6695.             Example:  time sleep 5
  6696.  
  6697.             See Also: time
  6698.  
  6699.           _________________________________________________________________
  6700.  
  6701.  
  6702.  
  6703.  
  6704.  
  6705.  
  6706.  
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.           SKsh Amiga Shell            Page 102            Reference Manual
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.           _________________________________________________________________
  6740.  
  6741.             Name:     source
  6742.  
  6743.             Type:     Builtin
  6744.  
  6745.             Default:  n/a
  6746.  
  6747.             Usage:    source [ file ... ]
  6748.  
  6749.             Range:    n/a
  6750.  
  6751.             About:    This  command  "sources" the named files; that  is,
  6752.                       they  are  executed, but not in a subshell, so that
  6753.                       any  variables, alias, etc,  that  they  define are
  6754.                       really defined in the parent's environment.
  6755.  
  6756.                       A single dot ('.') may be used to source a file  as
  6757.                       well; this is compatible with ksh and sh.
  6758.  
  6759.                       A file which is sourced does not have to  have  its
  6760.                       script bit set  (although it won't hurt).  However,
  6761.                       a script file which  is  to  be  executed by typing
  6762.                       its name must have its script bit set.
  6763.  
  6764.                       Executing a file is equivalent to:
  6765.  
  6766.                          ( source file )
  6767.  
  6768.             Example:  source my_init_file.sksh
  6769.  
  6770.             See Also:
  6771.  
  6772.           _________________________________________________________________
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.  
  6794.  
  6795.           SKsh Amiga Shell            Page 103            Reference Manual
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.           _________________________________________________________________
  6806.  
  6807.             Name:     stack
  6808.  
  6809.             Type:     Function
  6810.  
  6811.             Default:  n/a
  6812.  
  6813.             Usage:    obsolete
  6814.  
  6815.             Range:    n/a
  6816.  
  6817.             About:    This  function  was  obsoleted in SKsh 1.5.   See  the
  6818.                       Addendum1.5.doc file for an explanation.
  6819.  
  6820.             Example:
  6821.  
  6822.             See Also: Addendum1.5.doc
  6823.  
  6824.           _________________________________________________________________
  6825.  
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831.  
  6832.  
  6833.  
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.           SKsh Amiga Shell            Page 104            Reference Manual
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.           _________________________________________________________________
  6872.  
  6873.             Name:     SYSNAME
  6874.  
  6875.             Type:     Variable
  6876.  
  6877.             Default:  'Amiga'
  6878.  
  6879.             Usage:    $SYSNAME
  6880.  
  6881.             Range:    n/a
  6882.  
  6883.             About:    This  variable  describes the  system on which SKsh
  6884.                       is  currently  being run.  There is  currently only
  6885.                       one  version of SKsh, so this variable will contain
  6886.                       "Amiga".  If SKsh is ported to other  systems, this
  6887.                       variable can be used  to  determine the name of the
  6888.                       system.
  6889.  
  6890.             Example:  if [ "$SYSNAME" != 'Amiga' ]
  6891.                       then
  6892.                          echo "This script runs only on Amigas."
  6893.                       fi
  6894.  
  6895.             See Also: SHELL
  6896.  
  6897.           _________________________________________________________________
  6898.  
  6899.  
  6900.  
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.           SKsh Amiga Shell            Page 105            Reference Manual
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.           _________________________________________________________________
  6938.  
  6939.             Name:     time
  6940.  
  6941.             Type:     Keyword
  6942.  
  6943.             Default:  n/a
  6944.  
  6945.             Usage:    time statement
  6946.  
  6947.             Range:    n/a
  6948.  
  6949.             About:    time  executes the  statement and prints the execu-
  6950.                       tion time in seconds.
  6951.  
  6952.             Example:  time ( dir; sleep 2 )
  6953.  
  6954.             See Also:
  6955.  
  6956.           _________________________________________________________________
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.  
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.  
  6992.  
  6993.           SKsh Amiga Shell            Page 106            Reference Manual
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.           _________________________________________________________________
  7004.  
  7005.             Name:     touch
  7006.  
  7007.             Type:     Builtin
  7008.  
  7009.             Default:  n/a
  7010.  
  7011.             Usage:    touch [ file ... ]
  7012.  
  7013.             Range:    n/a
  7014.  
  7015.             About:    touch  create the named files if they do not exist,
  7016.                       and  in  any  case  updates the  file  modification
  7017.                       timestamp.   It  also   resets the AmigaDos archive
  7018.                       bit.
  7019.  
  7020.             Example:  touch aaa bbb ccc
  7021.  
  7022.             See Also:
  7023.  
  7024.           _________________________________________________________________
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.  
  7042.  
  7043.  
  7044.  
  7045.  
  7046.  
  7047.  
  7048.  
  7049.  
  7050.  
  7051.  
  7052.  
  7053.  
  7054.  
  7055.  
  7056.  
  7057.  
  7058.  
  7059.           SKsh Amiga Shell            Page 107            Reference Manual
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.           _________________________________________________________________
  7070.  
  7071.             Name:     true
  7072.  
  7073.             Type:     Builtin
  7074.  
  7075.             Default:  n/a
  7076.  
  7077.             Usage:    true
  7078.  
  7079.             Range:    n/a
  7080.  
  7081.             About:    true  simply  returns a true exit  code,  and  does
  7082.                       nothing else.
  7083.  
  7084.             Example:  while true
  7085.                       do
  7086.                          echo 'repeat forever!'
  7087.                          sleep 1
  7088.                       done
  7089.  
  7090.             See Also: false
  7091.  
  7092.           _________________________________________________________________
  7093.  
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099.  
  7100.  
  7101.  
  7102.  
  7103.  
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.           SKsh Amiga Shell            Page 108            Reference Manual
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.           _________________________________________________________________
  7136.  
  7137.             Name:     unalias
  7138.  
  7139.             Type:     Alias
  7140.  
  7141.             Default:  unset -a
  7142.  
  7143.             Usage:    unalias [ name ... ]
  7144.  
  7145.             Range:    n/a
  7146.  
  7147.             About:    This  alias  removes existing aliases from the cur-
  7148.                       rent context.  If no names are given,  the  command
  7149.                       has  no  effect.    Otherwise, each alias listed is
  7150.                       removed, if it was in fact an alias.
  7151.  
  7152.                       SKsh  supplied aliases may be  removed, but this is
  7153.                       not recommended.
  7154.  
  7155.             Example:  unalias my_alias my_other_alias
  7156.  
  7157.             See Also: unset
  7158.  
  7159.           _________________________________________________________________
  7160.  
  7161.  
  7162.  
  7163.  
  7164.  
  7165.  
  7166.  
  7167.  
  7168.  
  7169.  
  7170.  
  7171.  
  7172.  
  7173.  
  7174.  
  7175.  
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.           SKsh Amiga Shell            Page 109            Reference Manual
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.           _________________________________________________________________
  7202.  
  7203.             Name:     unfunc
  7204.  
  7205.             Type:     Alias
  7206.  
  7207.             Default:  unset -f
  7208.  
  7209.             Usage:    unfunc [ name ... ]
  7210.  
  7211.             Range:    n/a
  7212.  
  7213.             About:    This  alias  removes  existing  functions from  the
  7214.                       current context.  If no names are given,  the  com-
  7215.                       mand  has  no  effect.    Otherwise, each  function
  7216.                       listed is removed, if it was in fact an function.
  7217.  
  7218.                       SKsh  supplied  functions may be  removed, but this
  7219.                       is not recommended.
  7220.  
  7221.             Example:  unfunc my_function my_other_function
  7222.  
  7223.             See Also: unset
  7224.  
  7225.           _________________________________________________________________
  7226.  
  7227.  
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.  
  7234.  
  7235.  
  7236.  
  7237.  
  7238.  
  7239.  
  7240.  
  7241.  
  7242.  
  7243.  
  7244.  
  7245.  
  7246.  
  7247.  
  7248.  
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.  
  7255.  
  7256.  
  7257.           SKsh Amiga Shell            Page 110            Reference Manual
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.           _________________________________________________________________
  7268.  
  7269.             Name:     unset
  7270.  
  7271.             Type:     Builtin
  7272.  
  7273.             Default:  n/a
  7274.  
  7275.             Usage:    unset [ -favb ] [ name ... ] 
  7276.  
  7277.             Range:    n/a
  7278.  
  7279.             About:    This  command  removes the definition of functions,
  7280.                       aliases,  variables, or builtins (controlled by the
  7281.                       f, a, v, or b flags).  If no  flag  is  given,  the
  7282.                       default is to remove variable definitions.
  7283.  
  7284.                       Unsetting  a  builtin (with the -b option) does not
  7285.                       cause  actual code  to  be  removed from memory; it
  7286.                       simply  removes  all  internal  references to  that
  7287.                       command, such that  it  appears to no longer exist.
  7288.                       This  can  cause  problems if not  used  carefully;
  7289.                       only  attempt this if you are sure  you  know  what
  7290.                       effects this will  have.   For  example, if you re-
  7291.                       move  the  'exit'  builtin, you will not be able to
  7292.                       quit SKsh.
  7293.  
  7294.             Example:  unset -f my_func1 my_func2
  7295.  
  7296.             See Also: unfunc, unalias
  7297.  
  7298.           _________________________________________________________________
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.           SKsh Amiga Shell            Page 111            Reference Manual
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.           _________________________________________________________________
  7334.  
  7335.             Name:     variables
  7336.  
  7337.             Type:     Alias
  7338.  
  7339.             Default:  set -v
  7340.  
  7341.             Usage:    variables [ -s ] [ pattern ... ]
  7342.  
  7343.             Range:    n/a
  7344.  
  7345.             About:    This  alias  lists  defined variables.  The pattern
  7346.                       uses  normal wildcards, but must be quoted to avoid
  7347.                       being   interpreted  by  the   filename   expansion
  7348.                       mechanism.   If  the  pattern is omitted, all vari-
  7349.                       ables  are  listed  except those  beginning with an
  7350.                       underscore  character  (hidden variables).  For ex-
  7351.                       ample,  _ANSI_P1  is  a  hidden variable; if it was
  7352.                       printed  in  the  normal variable list, the display
  7353.                       pen would be changed.
  7354.  
  7355.                       Only  variables for the current context are listed,
  7356.                       so this  command may have a different effect inside
  7357.                       of   a   subshell  or   function  than  when  typed
  7358.                       manually.
  7359.  
  7360.             Example:  variables -s '[A-H]*'
  7361.  
  7362.             See Also: set
  7363.  
  7364.           _________________________________________________________________
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.  
  7381.  
  7382.  
  7383.  
  7384.  
  7385.  
  7386.  
  7387.  
  7388.  
  7389.           SKsh Amiga Shell            Page 112            Reference Manual
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.           _________________________________________________________________
  7400.  
  7401.             Name:     version
  7402.  
  7403.             Type:     Builtin
  7404.  
  7405.             Default:  n/a
  7406.  
  7407.             Usage:    version [ -ds ]
  7408.  
  7409.             Range:    n/a
  7410.  
  7411.             About:    version  with  no  options prints the SKsh  version
  7412.                       string  and  copyright notice.  The 'd' option ech-
  7413.                       oes  the  compile date of SKsh, and the 's'  option
  7414.                       prints  a   single   numeric  value  that  will  be
  7415.                       incremented  for  each  release of SKsh.   This  is
  7416.                       useful in tests, as below.
  7417.  
  7418.             Example:  if [ $(version -s) -lt 3 ]
  7419.                       then
  7420.                          echo  'This  script  requires   a   later   SKsh
  7421.                       version'
  7422.                       fi
  7423.  
  7424.             See Also:
  7425.  
  7426.           _________________________________________________________________
  7427.  
  7428.  
  7429.  
  7430.  
  7431.  
  7432.  
  7433.  
  7434.  
  7435.  
  7436.  
  7437.  
  7438.  
  7439.  
  7440.  
  7441.  
  7442.  
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448.  
  7449.  
  7450.  
  7451.  
  7452.  
  7453.  
  7454.  
  7455.           SKsh Amiga Shell            Page 113            Reference Manual
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.           _________________________________________________________________
  7466.  
  7467.             Name:     whence
  7468.  
  7469.             Type:     Builtin
  7470.  
  7471.             Default:  n/a
  7472.  
  7473.             Usage:    whence [ name ... ]
  7474.  
  7475.             Range:    n/a
  7476.  
  7477.             About:    whence  reports how each name would be  interpreted
  7478.                       if it was  used  as  a  command.   It  will  report
  7479.                       whether the name will  be  interpreted as a builtin
  7480.                       command,  an  alias,  a  function, or  an  external
  7481.                       statement.   If  the   command is interpreted as an
  7482.                       external  statement,  a  path  to  the  command  is
  7483.                       printed.
  7484.  
  7485.             Example:  whence whence if path ll
  7486.  
  7487.             See Also: which
  7488.  
  7489.           _________________________________________________________________
  7490.  
  7491.  
  7492.  
  7493.  
  7494.  
  7495.  
  7496.  
  7497.  
  7498.  
  7499.  
  7500.  
  7501.  
  7502.  
  7503.  
  7504.  
  7505.  
  7506.  
  7507.  
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513.  
  7514.  
  7515.  
  7516.  
  7517.  
  7518.  
  7519.  
  7520.  
  7521.           SKsh Amiga Shell            Page 114            Reference Manual
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.           _________________________________________________________________
  7532.  
  7533.             Name:     which
  7534.  
  7535.             Type:     Builtin
  7536.  
  7537.             Default:  n/a
  7538.  
  7539.             Usage:    which [ -s ] [ name ... ]
  7540.  
  7541.             Range:    n/a
  7542.  
  7543.             About:    which  searches  the  current PATH  variable for an
  7544.                       occurrence of name.  If it finds one, the  path  to
  7545.                       name is  printed.   Multiple names are accepted, in
  7546.                       which case the process is repeated for each one.
  7547.  
  7548.                       If  the  '-s'  option is set, which will  terminate
  7549.                       silently if the name is not  found  in  the  search
  7550.                       path.    Normally  it  prints  a  message  to  that
  7551.                       effect.
  7552.  
  7553.                       Although  which does  not  know  about  aliases  or
  7554.                       functions  as  whence does, it is often more useful
  7555.                       in scripts or from the  command line.  For example,
  7556.                       if you know that "my_file" is in the  search  path,
  7557.                       you can say:
  7558.  
  7559.                          ll $(which -s my_file)
  7560.  
  7561.                       to  print  information on  my_file  without knowing
  7562.                       where  it  is.   The  example below is another pos-
  7563.                       sible use.  In the  function, which is used both to
  7564.                       avoid  interpreting  "run"  recursively as a  func-
  7565.                       tion, and  to  find  the  desired binary.  A better
  7566.                       form  of  the  'run'  function is included with the
  7567.                       default '.skshinit' file.
  7568.  
  7569.             Example:  function run {
  7570.                          cmd="$1"
  7571.                          shift
  7572.                          $(which -s run) $(which $cmd) $*
  7573.                       }
  7574.  
  7575.             See Also: whence
  7576.  
  7577.           _________________________________________________________________
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.           SKsh Amiga Shell            Page 115            Reference Manual
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.           _________________________________________________________________
  7598.  
  7599.             Name:     while/do/done
  7600.  
  7601.             Type:     Keywords
  7602.  
  7603.             Default:  n/a
  7604.  
  7605.             Usage:    while expr do stmt_list done
  7606.  
  7607.             Range:    n/a
  7608.  
  7609.             About:    The  statement list  is  executed while the expres-
  7610.                       sion is true (returns a zero exit status).
  7611.  
  7612.             Example:  a=1
  7613.                       while [ $a -le 10 ]
  7614.                       do
  7615.                          echo "a = $a"
  7616.                       done
  7617.  
  7618.             See Also: for
  7619.  
  7620.           _________________________________________________________________
  7621.  
  7622.  
  7623.  
  7624.  
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.           SKsh Amiga Shell            Page 116            Reference Manual
  7654.  
  7655.  
  7656.  
  7657.