home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff342.lzh / SKsh / ExtCmds.doc < prev    next >
Text File  |  1990-04-15  |  31KB  |  1,387 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                              External Command Reference
  18.  
  19.                                         SKsh
  20.  
  21.                            A ksh-like Shell for the Amiga
  22.  
  23.                                      Version 1.4
  24.  
  25.  
  26.                                (Copyright) 1989, 1990
  27.  
  28.                                      Steve Koren
  29.  
  30.                                    March 19, 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.                Introduction......................................3
  76.                cmp...............................................4
  77.                cp................................................5
  78.                crc...............................................6
  79.                du................................................7
  80.                fgrep.............................................8
  81.                grep..............................................10
  82.                head..............................................12
  83.                join..............................................13
  84.                strings...........................................14
  85.                srun..............................................15
  86.                tail..............................................16
  87.                tee...............................................17
  88.                view..............................................18
  89.                wc................................................19
  90.                window............................................20
  91.                xd................................................21
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.           SKsh Amiga Shell             Page 2       External Cmd Reference
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           Introduction
  140.  
  141.             This reference manual describes each SKsh external  command  in
  142.             a  concise  manner.    Each   page   contains   the   following
  143.             information:
  144.  
  145.             Name:     The name of the command.
  146.  
  147.             Type:     Always External Command for  this  document;  may  be
  148.                       something else in the reference manual.
  149.  
  150.             Default:  Default parameters, if applicable.
  151.  
  152.             Usage:    Command syntax
  153.  
  154.             Range:    Legal values for variables or parameters
  155.  
  156.             About:    Text describing the command, variable, etc.
  157.  
  158.             Example:  A brief example usage.
  159.  
  160.             See Also: Other related commands, variables, etc.
  161.  
  162.             When reading the command syntax, anything  in  square  brackets
  163.             is optional.  Anything followed by three dots can  be  repeated
  164.             any number of times.   A  vertical  bar  is  used  to  separate
  165.             option where one or the other, but not both, can be used.
  166.  
  167.             In general, 'command -a -b' is equilivant to 'command -ab'.
  168.  
  169.             All external commands were re-written in SKsh 1.4  to  be  much
  170.             smaller and faster than their earlier counterparts.
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.           SKsh Amiga Shell             Page 3       External Cmd Reference
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           ________________________________________________________________
  206.  
  207.             Name:     cmp
  208.  
  209.             Type:     External Command
  210.  
  211.             Default:  n/a
  212.  
  213.             Usage:    cmp [ -s ] file1 file2
  214.  
  215.             Range:    n/a
  216.  
  217.             About:    cmp compares two files for  equality.   It  can  be
  218.                       used on binary as well  as  textual  data.   cmp is
  219.                       fast in that if the files are not  the  same  size,
  220.                       it won't even bother comparing the contents of  the
  221.                       files.     cmp  normally  outputs  a  message  that
  222.                       indicates  whether  the   files   are   the   same,
  223.                       different, or one is shorter than  the  other.   If
  224.                       the -s option is  used,  compare  does  not  output
  225.                       this information, but simply returns  a  zero  exit
  226.                       status if the files were the same, or  non-zero  if
  227.                       they were not.
  228.  
  229.             Example:  if cmp -s file1 file2
  230.                       then
  231.                          echo 'file1 is the same as file2'
  232.                       else
  233.                          echo 'file1 is different than file2'
  234.                       fi
  235.  
  236.             See Also:
  237.  
  238.           ________________________________________________________________
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.           SKsh Amiga Shell             Page 4       External Cmd Reference
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           ________________________________________________________________
  272.  
  273.             Name:     cp
  274.  
  275.             Type:     Builtin
  276.  
  277.             Default:  n/a
  278.  
  279.             Usage:    cp [ -nuv ] file { file | dir }
  280.                       cp [ -nruv ] { file | dir } ... dir
  281.  
  282.             Range:    n/a
  283.  
  284.             About:    cp  copies  files  from  one  place   to   another,
  285.                       optionally renaming them in the  process.   If  the
  286.                       destination is a  directory,  the  files  have  the
  287.                       same name in the destination  directory.   If  more
  288.                       than one file is copied, the  destination  must  be
  289.                       either  a  directory  or  nonexistant.   If  it  is
  290.                       nonexistant, it is created as a directory.
  291.  
  292.                       The -r flag causes cp to perform a recursive copy. 
  293.  
  294.                       The -v flag prints the name of each file as  it  is
  295.                       copied.
  296.  
  297.                       The  -n  flag  causes  cp  NOT  to  duplicate  file
  298.                       modification times  and  protection  flags  on  the
  299.                       destination files.  If you wish to  make  this  the
  300.                       default behavior, use this alias:
  301.  
  302.                          alias cp='$(which cp) -n'
  303.  
  304.                       cp will reset the AmigaDos archive bit  whether  or
  305.                       not the -v flag is used.
  306.  
  307.                       The -u flag causes  cp to operate in "update" mode;
  308.                       only  files  with  a  newer  timestamp  than  their
  309.                       associated destination are copied.
  310.  
  311.  
  312.             Example:  cp my_file1 m_file2 my_file3 my_directory
  313.  
  314.             Warnings:  The -c (clone) flag was obsoleted in SKsh 1.4.  It
  315.                       is  still  accepted  for  backward   compatibility;
  316.                       however, it is ignored.  Use the -n option to  turn
  317.                       off the clone behaviour.
  318.  
  319.                       The  cp command was changed to an  external  binary
  320.                       in SKsh 1.4.  It used to be a builtin.
  321.  
  322.             See Also: mv
  323.  
  324.           ________________________________________________________________
  325.  
  326.  
  327.           SKsh Amiga Shell             Page 5       External Cmd Reference
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ________________________________________________________________
  338.  
  339.             Name:     crc
  340.  
  341.             Type:     External Command
  342.  
  343.             Default:  n/a
  344.  
  345.             Usage:    crc file1 file2
  346.  
  347.             Range:    n/a
  348.  
  349.             About:    crc generates  several  32  bit  values  which  are
  350.                       computed from a file's contents.  These values  can
  351.                       be used to check the integrity of files  which  are
  352.                       transfered   over   a   medium   of    questionable
  353.                       reliability (such as phone lines).
  354.  
  355.             Example:  crc a_file another_file
  356.  
  357.             See Also:
  358.  
  359.           ________________________________________________________________
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.           SKsh Amiga Shell             Page 6       External Cmd Reference
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           ________________________________________________________________
  404.  
  405.             Name:     du
  406.  
  407.             Type:     External Command
  408.  
  409.             Default:  n/a
  410.  
  411.             Usage:    du [ -dkst ] dir ...
  412.  
  413.             Range:    n/a
  414.  
  415.             About:    du prints disk  usage  information  for  a  set  of
  416.                       directories.  For  each  directory  listed  on  the
  417.                       command line, the subtree rooted at that  point  is
  418.                       searched in a depth-first manner.   du adds all the
  419.                       file sizes, and for each directory, prints  1)  the
  420.                       directory name, 2) the total disk usage  for  files
  421.                       in this directory, and 3) the total disk usage  for
  422.                       the subtree rooted at this directory.
  423.  
  424.                       The following options are available:
  425.  
  426.                          -k   Print disk usage  in  1024  byte  kilobytes
  427.                               instead of the default bytes.
  428.  
  429.                          -s   Summary mode; print  disk  usage  only  for
  430.                               root  directories  listed  on  the  command
  431.                               line.  This option omits  the  display  for
  432.                               any   sub-directories,   but   still   must
  433.                               examine the  entire  directory  subtree  to
  434.                               find the total disk usage.
  435.  
  436.                          -d   Omit  the  first  disk  usage  number  (the
  437.                               total for this directory only).
  438.  
  439.                          -t   Omit the  second  disk  usage  number  (the
  440.                               total  for  the  subtree  rooted  at   this
  441.                               directory).   If  both  -t and -d are used,
  442.                               only directory names are printed.
  443.  
  444.             Example:  du devs: ram:
  445.                       du -s devs:
  446.  
  447.             Warnings: The  -k option rounds to the nearest kilobyte.  For
  448.                       example, a 1023 byte file is printed as 1K,  and  a
  449.                       511 byte file is printed as 0K.   This  means  that
  450.                       the rooted subtree disk usage count may not be  the
  451.                       sum of the directory  disk  usage  counts  for  all
  452.                       subdirectories.
  453.  
  454.             See Also: info
  455.  
  456.           ________________________________________________________________
  457.  
  458.  
  459.           SKsh Amiga Shell             Page 7       External Cmd Reference
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.           ________________________________________________________________
  470.  
  471.             Name:     fgrep
  472.  
  473.             Type:     External Command
  474.  
  475.             Default:  n/a
  476.  
  477.             Usage:    fgrep -[vxcilns] [-f pfile] [-e] pattern
  478.                          [ file ... ]
  479.  
  480.             Range:    n/a
  481.  
  482.             About:    fgrep provides  a  fast  way  to  search  for  text
  483.                       patterns in a set of  files.   It  is  similar  to,
  484.                       although more limited but faster than, grep.
  485.  
  486.                       fgrep searches for the  indicated  pattern  in  the
  487.                       indicated  set  of  files,  if  present,   or   the
  488.                       standard  input,  if  not.   An  fgrep  pattern  is
  489.                       extremely  limited;  it  can  be  either  a  string
  490.                       constant or a set of string constants separated  by
  491.                       percent signs.  For example, these are valid  fgrep
  492.                       statements:
  493.  
  494.                          fgrep my_routine *.c
  495.                          fgrep 'this%or%that' my_file my_other_file
  496.  
  497.                       In  the  second  example,  fgrep searches for lines
  498.                       containing any of the three strings.
  499.  
  500.                       There are a large number of options availble  which
  501.                       modify the actions of fgrep:
  502.  
  503.                       -c   Print only a count of matching lines for  each
  504.                            file.  If the 'v' option is used with the  'c'
  505.                            option,  a  count  of  non-matching  lines  is
  506.                            printed.
  507.  
  508.                       -e   Use the next argument as  the  pattern.   This
  509.                            is useful to  search  for  patterns  beginning
  510.                            with a dash.
  511.  
  512.                       -f   Use  the  next  argument  as  a   file   which
  513.                            contains a newline separated list  of  values.
  514.                            This file is read and used  in  place  of  the
  515.                            command  line  pattern.   For   example,   the
  516.                            following two examples are equivalent:
  517.  
  518.                               fgrep 'foo%bar' myfile
  519.  
  520.                               echo "foo" >temp; echo "bar" >>temp
  521.                               fgrep -f temp myfile
  522.  
  523.  
  524.  
  525.           SKsh Amiga Shell             Page 8       External Cmd Reference
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.                       -i   Ignore case in the  search.   Normally,  fgrep
  536.                            is case sensitive.
  537.  
  538.                       -l   Print only the names of files  which  containg
  539.                            the given pattern.  This  is  fast;  if  fgrep
  540.                            finds the pattern anywhere  in  the  file,  it
  541.                            will stop looking  and  proceed  to  the  next
  542.                            file.  This can  save  time  for  large  files
  543.                            where the task  is  to  discover  which  files
  544.                            contain the given pattern.
  545.  
  546.                       -n   Print the line  number  before  each  matching
  547.                            line.
  548.  
  549.                       -s   Print nothing.   Return  an  exit  code  of  0
  550.                            (true) if any file contained the  pattern,  or
  551.                            1 (false) if no files contained the pattern.
  552.  
  553.                       -v   Invert  the  search.   Lines  which   do   not
  554.                            contain the pattern are printed.
  555.  
  556.                       -x   Lines must  match  the  pattern  exactly,  not
  557.                            simply contain it.
  558.  
  559.             Example:  if grep -s my_pattern my_file
  560.                       then
  561.                          echo 'my_file contains my_pattern'
  562.                       fi
  563.  
  564.             Warnings: Patterns  which  contain  '%',  spaces,  or   other
  565.                       special characters should be quoted to avoid  being
  566.                       interpreted by the shell.
  567.  
  568.                       The '%'  character  is  used  to  separate  strings
  569.                       instead of  a  newline  in  Un*x,  as  there  is  a
  570.                       problem in AmigaDos passing  parameters  containing
  571.                       newlines to external commands.
  572.  
  573.             See Also: grep
  574.  
  575.           ________________________________________________________________
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.           SKsh Amiga Shell             Page 9       External Cmd Reference
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.           ________________________________________________________________
  602.  
  603.             Name:     grep
  604.  
  605.             Type:     External Command
  606.  
  607.             Default:  n/a
  608.  
  609.             Usage:    grep -[vxcilns] [-f pfile] [-e] pattern
  610.                          [ file ... ]
  611.  
  612.             Range:    n/a
  613.  
  614.             About:    grep provides a way to search for text patterns  in
  615.                       a set of files.  It is similar  to,  although  more
  616.                       powerful but slower than, fgrep.
  617.  
  618.                       grep searches for  the  indicated  pattern  in  the
  619.                       indicated  set  of  files,  if  present,   or   the
  620.                       standard input,  if  not.   A  grep  pattern  is  a
  621.                       limited regular  expression.   An  explaination  of
  622.                       regular expressions is beyond  the  scope  of  this
  623.                       document;  however,  it  should   be   noted   that
  624.                       although they appear  similar  to  wildcards,  they
  625.                       are much different (and more powerful).
  626.  
  627.                       There are a large number of options availble  which
  628.                       modify the actions of grep:
  629.  
  630.                       -c   Print only a count of matching lines for  each
  631.                            file.  If the 'v' option is used with the  'c'
  632.                            option,  a  count  of  non-matching  lines  is
  633.                            printed.
  634.  
  635.                       -e   Use the next argument as  the  pattern.   This
  636.                            is useful to  search  for  patterns  beginning
  637.                            with a dash.
  638.  
  639.                       -f   Use  the  next  argument  as  a   file   which
  640.                            contains  a   one-line   regular   expression.
  641.                            There can only be one  regular  expression  in
  642.                            this  version  of  grep,  so  this  option  is
  643.                            currently of limited use.   However,  if  grep
  644.                            is extended to  permit  multiple  expressions,
  645.                            the 'f' option will become more useful.
  646.  
  647.                       -i   Ignore case in the search.  Normally,  grep is
  648.                            case sensitive.
  649.  
  650.                       -l   Print only the names of files  which  containg
  651.                            the given pattern.   This  is  fast;  if  grep
  652.                            finds the pattern anywhere  in  the  file,  it
  653.                            will stop looking  and  proceed  to  the  next
  654.                            file.  This can  save  time  for  large  files
  655.  
  656.  
  657.           SKsh Amiga Shell            Page 10       External Cmd Reference
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                            where the task  is  to  discover  which  files
  668.                            contain the given pattern.
  669.  
  670.                       -n   Print the line  number  before  each  matching
  671.                            line.
  672.  
  673.                       -s   Print nothing.   Return  an  exit  code  of  0
  674.                            (true)  if  any  file  contained  the  regular
  675.                            expression, or 1 (false) otherwise.
  676.  
  677.                       -v   Invert  the  search.   Lines  which   do   not
  678.                            contain the regular expression are printed.
  679.  
  680.                       -x   The expression must be found at the  beginning
  681.                            of a line.
  682.  
  683.             Example:  if grep -s my_pattern my_file
  684.                       then
  685.                          echo 'my_file contains my_pattern'
  686.                       fi
  687.  
  688.             Warnings: Patterns which contain '*', '.', spaces,  or  other
  689.                       special characters should be quoted to avoid  being
  690.                       interpreted by the shell.
  691.  
  692.                       Be  wary  of  the  difference  in  the  'x'  option
  693.                       between fgrep and grep.
  694.  
  695.                       fgrep often more  useful  than  grep because of its
  696.                       greater speed  and  smaller  size.   This  is  most
  697.                       noticable on fast  devices  such  as  ram  or  hard
  698.                       disks.
  699.  
  700.             See Also: fgrep
  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       External Cmd Reference
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.           ________________________________________________________________
  734.  
  735.             Name:     head
  736.  
  737.             Type:     External Command
  738.  
  739.             Default:  num = 10
  740.  
  741.             Usage:    head [ -num ] [ file ... ]
  742.  
  743.             Range:    0 <= num
  744.  
  745.             About:    head  prints  the  first  num lines of  each  named
  746.                       file,  or  the  standard  input  if  no  files  are
  747.                       indicated.  If  num is not explicitly set, it has a
  748.                       default value of 10.
  749.  
  750.             Example:  head -5 my_file.c my_other_file.c
  751.  
  752.             See Also: tail
  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       External Cmd Reference
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.           ________________________________________________________________
  800.  
  801.             Name:     join
  802.  
  803.             Type:     External Command
  804.  
  805.             Default:  n/a
  806.  
  807.             Usage:    join [ -a ] source1 [ source2 ... ] destination
  808.  
  809.             Range:    n/a
  810.  
  811.             About:    The  join command concatinates binary or ascii data
  812.                       from multiple files into a single file,  optionally
  813.                       appending the data to the destination file  if  the
  814.                       -a flag is set.  The destination file is  the  last
  815.                       one given.
  816.  
  817.             Example:  join file1 file2 dest_file
  818.  
  819.             See Also:
  820.  
  821.           ________________________________________________________________
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  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       External Cmd Reference
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.           ________________________________________________________________
  866.  
  867.             Name:     strings
  868.  
  869.             Type:     External Command
  870.  
  871.             Default:  num = 6
  872.  
  873.             Usage:    strings [ -num ] [ file ... ]
  874.  
  875.             Range:    0 <= num
  876.  
  877.             About:    strings searches the named files for strings of  at
  878.                       least  num consecutive  printable  characters.   If
  879.                       found,  it  prints  them.   If   num is not set, it
  880.                       defaults to 6.
  881.  
  882.             Example:  strings -10 my_file.o binary_file
  883.  
  884.             See Also:
  885.  
  886.           ________________________________________________________________
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.           SKsh Amiga Shell            Page 14       External Cmd Reference
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.           ________________________________________________________________
  932.  
  933.             Name:     srun
  934.  
  935.             Type:     External Command
  936.  
  937.             Default:  stk = 4000
  938.                       pri = 0
  939.  
  940.             Usage:    srun [ -i file ] [ -o file ] [ -s stk ] [ -p pri ]
  941.                          program [ args ]
  942.  
  943.             Range:    4000 <= stk
  944.                       -31 <= pri <= 31
  945.  
  946.             About:    srun was created to overcome  certain  deficiencies
  947.                       in the  AmigaDos  run command.  srun is most useful
  948.                       in scripts or functions, although it  can  also  be
  949.                       used from the  command  line.   It  allows  you  to
  950.                       specify an input file,  output  file,  stack  size,
  951.                       and priority for a command  which  is  run  in  the
  952.                       background.  Standard input and  output  cannot  be
  953.                       re-directed  with  the  AmigaDos  run command.  The
  954.                       srun command is very useful in  functions  such  as
  955.                       the one given below (very much simplified from  one
  956.                       given in the Stuff.sksh file).
  957.  
  958.             Example:  function zmore {
  959.                          srun -o pipe:tmp $(which zoo) -print "$1" "$2"
  960.                          more pipe:tmp
  961.                       }
  962.  
  963.             See Also: run
  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       External Cmd Reference
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.           ________________________________________________________________
  998.  
  999.             Name:     tail
  1000.  
  1001.             Type:     External Command
  1002.  
  1003.             Default:  num = 10, '-' option
  1004.  
  1005.             Usage:    tail [ -num | +num ] [ file ... ]
  1006.  
  1007.             Range:    0 <= num <= 32000
  1008.  
  1009.             About:    tail prints the last  num lines of each named file,
  1010.                       or the standard input if no files are named.  If  a
  1011.                       '+'  precedes  num instead of a  '-',  tail instead
  1012.                       skips num lines and prints the rest of the file.
  1013.  
  1014.                       In  SKsh  1.4,  the  algorithm  used  by  tail  was
  1015.                       changed.  If run on a file, it  will  now  seek  to
  1016.                       the end of the file and  read  backwards  until  it
  1017.                       encounters  the  proper  line.   This  means   that
  1018.                       running   tail  on  a  large  file  is  now  nearly
  1019.                       instantaneous; previously, it  would  read  in  the
  1020.                       entire file.
  1021.  
  1022.             Example:  tail -15 my_file.c my_other_file.c
  1023.  
  1024.             See Also: head
  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       External Cmd Reference
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.           ________________________________________________________________
  1064.  
  1065.             Name:     tee
  1066.  
  1067.             Type:     External Command
  1068.  
  1069.             Default:  n/a
  1070.  
  1071.             Usage:    tee [ -a ] [ file ... ]
  1072.  
  1073.             Range:    less than 32 files
  1074.  
  1075.             About:    tee copies  its  standard  input  to  its  standard
  1076.                       output, and also  to  any  named  files.   The  old
  1077.                       contents of the files are  overwritten  unless  the
  1078.                       append (-a) flag is used.  With no  arguments,  tee
  1079.                       simply copies its input to its output.
  1080.  
  1081.             Example:  fgrep foo my_file | tee save_foo | wc -c
  1082.  
  1083.             See Also:
  1084.  
  1085.           _______________________________________________________________
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.           SKsh Amiga Shell            Page 17       External Cmd Reference
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.           ________________________________________________________________
  1130.  
  1131.             Name:     view
  1132.  
  1133.             Type:     External Command
  1134.  
  1135.             Default:  n/a
  1136.  
  1137.             Usage:    see View.doc
  1138.  
  1139.             Range:    n/a
  1140.  
  1141.             About:    view is a command which allows  other  commands  to
  1142.                       be called based on the type of a given  file.   See
  1143.                       the  View.doc manual for a  detail  description  of
  1144.                       this command.
  1145.  
  1146.             Example:
  1147.  
  1148.             See Also:
  1149.  
  1150.           ________________________________________________________________
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  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       External Cmd Reference
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.           ________________________________________________________________
  1196.  
  1197.             Name:     wc
  1198.  
  1199.             Type:     External Command
  1200.  
  1201.             Default:  n/a
  1202.  
  1203.             Usage:    wc [ -hcwlqt ] [ file ... ]
  1204.  
  1205.             Range:    n/a
  1206.  
  1207.             About:    wc is a utility which counts characters, words,  or
  1208.                       lines in a given series of files (or  the  standard
  1209.                       input, if no files  are  indicated).   It  normally
  1210.                       produces information on all three counts,  preceded
  1211.                       by a title for each column.  If  the  c,  w,  or  l
  1212.                       flags are  set,  only  information  on  characters,
  1213.                       words,  or  lines  is  printed.   (These   can   be
  1214.                       combined; for example 'wc -cl').  If the q flag  is
  1215.                       set,  wc does its work quietly; that is, it  leaves
  1216.                       out titles  and  file  names,  only  reporting  the
  1217.                       actual counts.  The t flag can be used to obtain  a
  1218.                       total at the end, and the h flag prints  a  helpful
  1219.                       usage message.
  1220.  
  1221.             Example:  if [ $(wc -lq my_file) -lt 10 ]
  1222.                       then
  1223.                          echo "There must be at least 10 lines"
  1224.                       fi
  1225.  
  1226.             See Also:
  1227.  
  1228.           ________________________________________________________________
  1229.  
  1230.  
  1231.  
  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       External Cmd Reference
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.           ________________________________________________________________
  1262.  
  1263.             Name:     window
  1264.  
  1265.             Type:     External Command
  1266.  
  1267.             Default:  n/a
  1268.  
  1269.             Usage:    window [ -back ] [ -front ] [ -title ]
  1270.                          [ -pos [x,y] ] [ -size [x,y] ] [ -scrsize ]
  1271.                          [ -wmouse ] [ -smouse ]
  1272.  
  1273.             Range:    n/a
  1274.  
  1275.             About:    window is a command which allows parameters of  the
  1276.                       current shell window to be  modified  or  examined.
  1277.                       The -back and -front flags cause the window  to  be
  1278.                       sent to the back or front.  The -title flag  causes
  1279.                       the current window title to be printed.   The  -pos
  1280.                       flag with no following parameters can  be  used  to
  1281.                       find the current x and y positions of  the  window.
  1282.                       With a comma separated set  of  numbers,  it  moves
  1283.                       the  window   to   that   position   if   possible.
  1284.                       Similarly, the -size parameter either  reports  the
  1285.                       size of the current window in  pixels,  or  resizes
  1286.                       the window to that size if possible.  The  -scrsize
  1287.                       flag  reports  the  current  size  of  the   screen
  1288.                       containing this  window,  and  the  -smouse  and  -
  1289.                       wmouse flags report the  cursor  position  relative
  1290.                       to the screen or window.
  1291.  
  1292.                       With  no  parameters,  the  window command prints a
  1293.                       helpful  usage  message.   Note  that  this   usage
  1294.                       message contains one additional  option  which  can
  1295.                       be included after the -title  flag  to  change  the
  1296.                       window title to a set value.  However, this is  not
  1297.                       actually permitted by  AmigaDos,  and  although  it
  1298.                       works now, it may cause problems, and  its  use  is
  1299.                       not recommended.  Use at your own risk.
  1300.  
  1301.             Example:  # move window to back and upper left hand corner
  1302.                       window -back -pos 0,0
  1303.  
  1304.             See Also:
  1305.  
  1306.           ________________________________________________________________
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.           SKsh Amiga Shell            Page 20       External Cmd Reference
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.           ________________________________________________________________
  1328.  
  1329.             Name:     xd
  1330.  
  1331.             Type:     External Command
  1332.  
  1333.             Default:  n/a
  1334.  
  1335.             Usage:    xd [ file ... ]
  1336.  
  1337.             Range:    n/a
  1338.  
  1339.             About:    xd (hex dump)  prints  a  hexadecimal  dump  of  each
  1340.                       named file, or the standard input  if  no  files  are
  1341.                       named.  It prints the  hex  address  of  the  current
  1342.                       offset as 8 digits, then  a  hex  dump  of  16  bytes
  1343.                       separated into groups  of  2  bytes,  then  an  ASCII
  1344.                       representation of the 16 bytes, or '.'  if  the  byte
  1345.                       is not a printable character.
  1346.  
  1347.             Example:  xd any_old_file
  1348.  
  1349.             See Also:
  1350.  
  1351.           ________________________________________________________________
  1352.  
  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       External Cmd Reference
  1384.  
  1385.  
  1386.  
  1387.