home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk381.lzh / SKsh / ExtCmds.doc < prev    next >
Text File  |  1990-10-20  |  51KB  |  2,047 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.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.                Introduction......................................3
  76.                cat...............................................4
  77.                cmp...............................................5
  78.                cp................................................6
  79.                crc...............................................7
  80.                cut...............................................8
  81.                du................................................9
  82.                encr..............................................10
  83.                fgrep.............................................11
  84.                find..............................................13
  85.                grep..............................................17
  86.                head..............................................19
  87.                indent............................................20
  88.                join..............................................21
  89.                num...............................................22
  90.                srun..............................................23
  91.                strings...........................................24
  92.                tail..............................................26
  93.                tee...............................................27
  94.                view..............................................28
  95.                wc................................................29
  96.                window............................................30
  97.                xd................................................31
  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 op-
  165.             tion 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.   In  1.5
  171.             they are slightly smaller yet.
  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:     cat
  208.  
  209.             Type:     External Command
  210.  
  211.             Default:  n/a
  212.  
  213.             Usage:    cat [ file ... ]
  214.  
  215.             Range:    n/a
  216.  
  217.             About:    cat  copies the files named on the  command line to
  218.                       its  standard output.  If no files  are  named,  it
  219.                       copies the standard input to the standard output.
  220.  
  221.                       The  cat  external command is provided as an alter-
  222.                       native to  the  builtin form; this one can copy bi-
  223.                       nary data as well as ASCII data and is much  faster
  224.                       when the output is redirected to a file.
  225.  
  226.                       To use the  external cat command by default, insert
  227.                       the following line into your .skshrc file:
  228.  
  229.                          unset -b cat
  230.  
  231.             Example:  cat myfile.foo
  232.  
  233.             See Also: The cat command entry in Reference.doc
  234.  
  235.           ________________________________________________________________
  236.  
  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:     cmp
  274.  
  275.             Type:     External Command
  276.  
  277.             Default:  n/a
  278.  
  279.             Usage:    cmp [ -s ] file1 file2
  280.  
  281.             Range:    n/a
  282.  
  283.             About:    cmp  compares two files for equality.   It  can  be
  284.                       used  on  binary as well  as  textual data.  cmp is
  285.                       fast in that if the files are not  the  same  size,
  286.                       it won't even bother  comparing the contents of the
  287.                       files.    cmp normally outputs a message that indi-
  288.                       cates whether the files are  the  same,  different,
  289.                       or one is shorter than the other.  If  the  -s  op-
  290.                       tion is  used,  compare does not output this infor-
  291.                       mation,  but  simply  returns a zero exit status if
  292.                       the files were the same, or non-zero if  they  were
  293.                       not.
  294.  
  295.             Example:  if cmp -s file1 file2
  296.                       then
  297.                          echo 'file1 is the same as file2'
  298.                       else
  299.                          echo 'file1 is different than file2'
  300.                       fi
  301.  
  302.             See Also:
  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       External Cmd Reference
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ________________________________________________________________
  338.  
  339.             Name:     cp
  340.  
  341.             Type:     External Command
  342.  
  343.             Default:  n/a
  344.  
  345.             Usage:    cp [ -nuv ] file { file | dir }
  346.                       cp [ -nruv ] { file | dir } ... dir
  347.  
  348.             Range:    n/a
  349.  
  350.             About:    cp  copies files from one place to another, option-
  351.                       ally  renaming them in the process.  If the  desti-
  352.                       nation  is  a  directory, the files have  the  same
  353.                       name  in  the  destination directory.  If more than
  354.                       one file is  copied, the destination must be either
  355.                       a  directory or nonexistant.  If it is nonexistant,
  356.                       it is created as a directory.
  357.  
  358.                       The -r flag causes cp to perform a recursive copy. 
  359.  
  360.                       The -v flag prints the name of each file as  it  is
  361.                       copied.
  362.  
  363.                       The -n flag causes cp NOT  to  duplicate file modi-
  364.                       fication times  and  protection flags on the desti-
  365.                       nation files.  If you wish to  make  this  the  de-
  366.                       fault behavior, use this alias:
  367.  
  368.                          alias cp='$(which cp) -n'
  369.  
  370.                       cp  will  reset the AmigaDos archive bit whether or
  371.                       not the -v flag is used.
  372.  
  373.                       The -u flag causes  cp to operate in "update" mode;
  374.                       only files with a newer  timestamp than their asso-
  375.                       ciated destination are copied.
  376.  
  377.  
  378.             Example:  cp my_file1 m_file2 my_file3 my_directory
  379.  
  380.             Warnings:  The -c (clone) flag was obsoleted in SKsh 1.4.  It
  381.                       is still  accepted for backward compatibility; how-
  382.                       ever, it is ignored.   Use  the  -n  option to turn
  383.                       off the clone behaviour.
  384.  
  385.                       The  cp  command was changed to an  external binary
  386.                       in SKsh 1.4.  It used to be a builtin.
  387.  
  388.             See Also: mv
  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:     crc
  406.  
  407.             Type:     External Command
  408.  
  409.             Default:  n/a
  410.  
  411.             Usage:    crc [ -q ] file1 [ file2 ] ...
  412.  
  413.             Range:    n/a
  414.  
  415.             About:    crc  generates several 32 bit values which are com-
  416.                       puted from a file's contents.  These  values can be
  417.                       used  to  check  the  integrity of files which  are
  418.                       transfered over a  medium of questionable reliabil-
  419.                       ity (such as phone lines).
  420.  
  421.                       If the -q switch is  given,  crc will not print the
  422.                       file name.  This is  useful in scripts to check the
  423.                       validity  of  a  file  by  comparing  crc output to
  424.                       known good values.
  425.  
  426.             Example:  crc a_file another_file
  427.  
  428.             See Also:
  429.  
  430.           ________________________________________________________________
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  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:     cut
  472.  
  473.             Type:     External Command
  474.  
  475.             Default:  n/a
  476.  
  477.             Usage:    cut [ -flist [ -dchar ] | -clist ] [ file ... ]
  478.  
  479.             Range:    n/a
  480.  
  481.             About:    Cut  is  used  for  making vertical slices though a
  482.                       file based  on  character position or on fields de-
  483.                       limited  by  a  defined character.  It can also  be
  484.                       used  to  re-order  characters or fields  within  a
  485.                       file.
  486.  
  487.                       The -c  option cuts based on character positions in
  488.                       the  line.   For  example, "-c1,5-10,20" would copy
  489.                       characters one, five though ten,  and  twenty  from
  490.                       each  input line  to  the  output line. If the list
  491.                       begins  with  a  dash  (for  example, "-c-10")  the
  492.                       first item is used  implicitly (1 though 10 in this
  493.                       case).    Characters  beyond the end  of  line  are
  494.                       ignored.
  495.  
  496.                       The  -f  option cuts based on field position within
  497.                       a line.  Fields are  separated by the tab character
  498.                       by  default, but this can be changed  with  the  -d
  499.                       option.   For  example, "-d:" would use colon sepa-
  500.                       rated fields.   Repeated strings of the field sepa-
  501.                       rator  indicate empty  fields.   Fields  beyond the
  502.                       last in the record are ignored.
  503.  
  504.                       No  space  may  occur between the -d option and the
  505.                       field  separator character, or between the -f or -c
  506.                       options and the list.
  507.  
  508.  
  509.  
  510.             Example:  cut -c1-10,15,20-50 myfile.txt
  511.                       cut -f1,3,5-7 -d: myfile1.txt
  512.  
  513.             See Also:
  514.  
  515.           ________________________________________________________________
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.           SKsh Amiga Shell             Page 8       External Cmd Reference
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           ________________________________________________________________
  536.  
  537.             Name:     du
  538.  
  539.             Type:     External Command
  540.  
  541.             Default:  n/a
  542.  
  543.             Usage:    du [ -dkst ] dir ...
  544.  
  545.             Range:    n/a
  546.  
  547.             About:    du  prints  disk  usage  information for a  set  of
  548.                       directories.   For  each   directory listed on  the
  549.                       command line,  the  subtree rooted at that point is
  550.                       searched in a depth-first manner.   du adds all the
  551.                       file sizes, and for  each  directory, prints 1) the
  552.                       directory name, 2)  the  total disk usage for files
  553.                       in this  directory, and 3) the total disk usage for
  554.                       the subtree rooted at this directory.
  555.  
  556.                       The following options are available:
  557.  
  558.                          -k   Print  disk  usage in 1024  byte  kilobytes
  559.                               instead of the default bytes.
  560.  
  561.                          -s   Summary  mode;  print  disk  usage only for
  562.                               root  directories  listed  on  the  command
  563.                               line.   This   option omits the display for
  564.                               any sub-directories, but still  must  exam-
  565.                               ine  the  entire  directory subtree to find
  566.                               the total disk usage.
  567.  
  568.                          -d   Omit the first  disk  usage number (the to-
  569.                               tal for this directory only).
  570.  
  571.                          -t   Omit the  second disk usage number (the to-
  572.                               tal for  the  subtree rooted at this direc-
  573.                               tory).   If  both  -t and -d are used, only
  574.                               directory names are printed.
  575.  
  576.             Example:  du devs: ram:
  577.                       du -s devs:
  578.  
  579.             Warnings: The  -k option rounds to the nearest kilobyte.  For
  580.                       example, a 1023 byte file is printed as 1K,  and  a
  581.                       511 byte file is printed as 0K.   This  means  that
  582.                       the rooted  subtree disk usage count may not be the
  583.                       sum  of  the  directory  disk  usage counts for all
  584.                       subdirectories.
  585.  
  586.             See Also: info
  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:     encr
  604.  
  605.             Type:     External Command
  606.  
  607.             Default:  n/a
  608.  
  609.             Usage:    encr { -d|-e } key { infile | - } { outfile | - }
  610.  
  611.             Range:    4 <= strlen(key) <= max parameter length
  612.  
  613.             About:    encr  encrypts  (-e)  and  decrypts (-d) files,  or
  614.                       standard  input  and  output if the  file  name  is
  615.                       given as a dash.  The key value must  be  the  same
  616.                       for  the  encrypt  and  decrypt; otherwise, garbage
  617.                       will result.   The  key  may  be  of  any  passable
  618.                       length.  Longer keys  will  result in a more secure
  619.                       encryption.
  620.  
  621.                       The  encrypted data will in most cases not be ASCII
  622.                       data.    However, this can be an  advantage in that
  623.                       encr  can  be  used  to  encrypt  binary as well as
  624.                       ASCII data.
  625.  
  626.                       If  encrypted data is  to  be  compressed, the com-
  627.                       press  operation  should  be  performed  before the
  628.                       data is  encrypted, not after.  This is because the
  629.                       encrypted  data  will  appear  random, and hence be
  630.                       difficult to compress by the standard algorithms.
  631.  
  632.                       encr does not use the DES  algorithm, as code based
  633.                       on  that  algorithm is not shippable outside of the
  634.                       United States.  (This is a bit  paranoid if you ask
  635.                       me, but no one did).  For  obvious reasons, I'm not
  636.                       going  to  describe  the  encr algorithm here.  The
  637.                       algorithm should  be  plenty  secure enough to dis-
  638.                       courage  casual  perusal of  encrypted data.  It is
  639.                       probably  not  secure enough to keep  data  from  a
  640.                       dedicated   cryptoanalyst,  or  perhaps  even  from
  641.                       someone who is  willing to closely examine a disas-
  642.                       sembly  of  the  program code.  I  have  provided a
  643.                       small  file  with  this  release of SKsh which con-
  644.                       tains some encrypted english  text;  I  would  very
  645.                       much like  to  hear  if  anyone manages to find out
  646.                       what it says.  The file is called "crypted_data". 
  647.  
  648.             Example:  encr -e mykey plainfile encryptedfile
  649.                       encr -d mykey encryptedfile plainfile
  650.  
  651.             See Also:
  652.  
  653.           ________________________________________________________________
  654.  
  655.  
  656.  
  657.           SKsh Amiga Shell            Page 10       External Cmd Reference
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.           ________________________________________________________________
  668.  
  669.             Name:     fgrep
  670.  
  671.             Type:     External Command
  672.  
  673.             Default:  n/a
  674.  
  675.             Usage:    fgrep -[vxcilns] [-f pfile] [-e] pattern
  676.                          [ file ... ]
  677.  
  678.             Range:    n/a
  679.  
  680.             About:    fgrep  provides a fast way to search for text  pat-
  681.                       terns in a set of  files.   It  is  similar to, al-
  682.                       though more limited but faster than, grep.
  683.  
  684.                       fgrep  searches  for  the  indicated pattern in the
  685.                       indicated set of files, if present,  or  the  stan-
  686.                       dard  input, if not.  An fgrep pattern is extremely
  687.                       limited; it  can  be  either a string constant or a
  688.                       set  of  string   constants  separated  by  percent
  689.                       signs.   For  example, these are valid fgrep state-
  690.                       ments:
  691.  
  692.                          fgrep my_routine *.c
  693.                          fgrep 'this%or%that' my_file my_other_file
  694.  
  695.                       In  the  second  example,  fgrep searches for lines
  696.                       containing any of the three strings.
  697.  
  698.                       There are a large  number of options availble which
  699.                       modify the actions of fgrep:
  700.  
  701.                       -c   Print only a count of  matching lines for each
  702.                            file.  If the 'v'  option is used with the 'c'
  703.                            option,  a  count  of  non-matching  lines  is
  704.                            printed.
  705.  
  706.                       -e   Use  the  next  argument as the pattern.  This
  707.                            is  useful to  search  for  patterns beginning
  708.                            with a dash.
  709.  
  710.                       -f   Use  the  next  argument as a file which  con-
  711.                            tains  a  newline  separated list  of  values.
  712.                            This file is read and used  in  place  of  the
  713.                            command line pattern.   For  example, the fol-
  714.                            lowing two examples are equivalent:
  715.  
  716.                               fgrep 'foo%bar' myfile
  717.  
  718.                               echo "foo" >temp; echo "bar" >>temp
  719.                               fgrep -f temp myfile
  720.  
  721.  
  722.  
  723.           SKsh Amiga Shell            Page 11       External Cmd Reference
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.                       -i   Ignore case in  the  search.   Normally, fgrep
  734.                            is case sensitive.
  735.  
  736.                       -l   Print only the names of files  which  containg
  737.                            the given pattern.  This  is  fast;  if  fgrep
  738.                            finds  the  pattern  anywhere in the file,  it
  739.                            will  stop  looking  and  proceed to the  next
  740.                            file.  This can  save  time  for  large  files
  741.                            where  the  task  is  to  discover which files
  742.                            contain the given pattern.
  743.  
  744.                       -n   Print  the  line  number  before each matching
  745.                            line.
  746.  
  747.                       -s   Print  nothing.    Return an exit  code  of  0
  748.                            (true) if any  file  contained the pattern, or
  749.                            1 (false) if no files contained the pattern.
  750.  
  751.                       -v   Invert the search.  Lines which  do  not  con-
  752.                            tain the pattern are printed.
  753.  
  754.                       -x   Lines  must  match  the  pattern  exactly, not
  755.                            simply contain it.
  756.  
  757.             Example:  if grep -s my_pattern my_file
  758.                       then
  759.                          echo 'my_file contains my_pattern'
  760.                       fi
  761.  
  762.             Warnings: Patterns  which  contain '%', spaces, or other spe-
  763.                       cial  characters should be quoted  to  avoid  being
  764.                       interpreted by the shell.
  765.  
  766.                       The  '%'  character is used to separate strings in-
  767.                       stead of a newline as in Un*x, as there is a  prob-
  768.                       lem  in  AmigaDos   passing  parameters  containing
  769.                       newlines to external commands.
  770.  
  771.             See Also: grep
  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:     find
  802.  
  803.             Type:     External Command
  804.  
  805.             Default:  n/a
  806.  
  807.             Usage:    find paths [ -print ] [ -exec command ]
  808.                          [ -cmd command ] [ -type {d|f} ] [ -hidden ]
  809.                          [ -depth ] [ -case ] [ -blocks n ]
  810.                          [ -bigger n ] [ -smaller n ] [ -ver | -v ]
  811.                          [ -comment pattern ] [ -name pattern ]
  812.                          [ -path pattern ] [ -quiet ]
  813.                          [ -newer { file | date [ time ] } ]
  814.                          [ -older { file | date [ time ] } ]
  815.  
  816.             Range:    n/a
  817.  
  818.             About:    Find  recursively  walks  the  directory hierarchy,
  819.                       applying  certain tests to files  and  performing a
  820.                       defined  action on  files  which  pass  the  tests.
  821.                       Find may be given one or more path  parameters fol-
  822.                       lowed by zero or more  switches.   Usually at least
  823.                       one of the following two switches is used:
  824.  
  825.                       -print       Print the files for  which  the  given
  826.                                    tests    are    true.     Files    and
  827.                                    directories  are  listed  to  standard
  828.                                    output, one per line.   If  the  paths
  829.                                    given to find  are  absolute, the out-
  830.                                    put will be also.  If the  input paths
  831.                                    are   relative,  the  output  will  be
  832.                                    relative to the same location.
  833.  
  834.                       -cmd         The  first   argument  following  this
  835.                                    switch is used as a  format string for
  836.                                    the output.   Any  occurrences of "%s"
  837.                                    (without the quotes)  are  replaced by
  838.                                    the  output  path  name.   Results are
  839.                                    sent to  standard output.  This is of-
  840.                                    ten  useful to build a script file for
  841.                                    later interpretation by the shell.
  842.  
  843.                       The  other  switches  indicate conditions which are
  844.                       "anded" together.  A  file  or  directory must meet
  845.                       all  conditions to be  selected.   If  patterns are
  846.                       given to any switches, they must be quoted.
  847.  
  848.                       -type        The  first   argument  following  this
  849.                                    switch  is  either "d", which  selects
  850.                                    only  directories, or "f",  which  se-
  851.                                    lects only files.
  852.  
  853.  
  854.  
  855.           SKsh Amiga Shell            Page 13       External Cmd Reference
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                       -name        The file name must match  the  pattern
  866.                                    given as  the  next  parameter.   Only
  867.                                    the  file  portion (the  basename)  of
  868.                                    the path must match.
  869.  
  870.                       -path        Similar to -name, but the  given  pat-
  871.                                    tern must match  the  entire path, not
  872.                                    just the file portion.  Slashes  ("/")
  873.                                    are not treated specially.
  874.  
  875.                       -comment     A  file's  comment, if it exists, must
  876.                                    match  the  pattern given as the  next
  877.                                    parameter.
  878.  
  879.                       -case        Normally all  pattern matching is case
  880.                                    insensitive.  This  switch  will  make
  881.                                    it case sensitive.
  882.  
  883.                       -depth       Causes find  to  perform a depth-first
  884.                                    scan.      Normally   directories  are
  885.                                    listed  before  their  contents;  this
  886.                                    switch reverses that order.
  887.  
  888.                       -blocks      The  following  parameter, which  must
  889.                                    be  numeric, is  treated  as  a  block
  890.                                    size.  All files  containing this num-
  891.                                    ber of blocks are selected.
  892.  
  893.                       -bigger      The  following  parameter  is  a  byte
  894.                                    count.   All  files   having this many
  895.                                    bytes or more are selected.
  896.  
  897.                       -smaller     Similar to  -bigger, but selects files
  898.                                    having this byte count or less.
  899.  
  900.                       -newer       Has  several forms.  If the  following
  901.                                    parameter is a  file  name,  then  all
  902.                                    files which are newer  (have  a  later
  903.                                    datestamp)   than   this   file    are
  904.                                    selected.   If  followed by one param-
  905.                                    eter which is a date in  AmigaDos  dd-
  906.                                    mmm-yy  format, files newer than  this
  907.                                    date are  selected (files created any-
  908.                                    time  after 12:00am are  considered to
  909.                                    be newer).   If  given  two  following
  910.                                    arguments, the first  of  which  is  a
  911.                                    date  in  the  above  format, and  the
  912.                                    second of which is a time in  hh:mm:ss
  913.                                    format, then  files  newer  than  this
  914.                                    are selected.
  915.  
  916.                       -older       Similar to -newer.
  917.  
  918.  
  919.  
  920.  
  921.           SKsh Amiga Shell            Page 14       External Cmd Reference
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.                       -quiet       Normally  find  will  print  an  error
  932.                                    message if it  is  unable to examine a
  933.                                    file  or  directory's   entry.    This
  934.                                    might  happen, for example, if another
  935.                                    process  has  this   file   open   for
  936.                                    writing.  This switch will cause  find
  937.                                    to  silently skip these files; this is
  938.                                    useful with the -cmd option.
  939.  
  940.                       -hidden      Normally  files  which  are   "hidden"
  941.                                    (ie, have the  +h  bit  set)  are  not
  942.                                    seen  by  find.   This  switch  causes
  943.                                    find to list these files.
  944.  
  945.                       -exec        The  following parameter is taken as a
  946.                                    command.  All  occurrences of "%s" are
  947.                                    replaced  by  the  file  or  directory
  948.                                    name,   and   the   string   is   then
  949.                                    executed.   If  the  resulting command
  950.                                    returns  successfully (ie,  with  exit
  951.                                    code 0), then the  file  or  directory
  952.                                    is    selected.     Otherwise,  it  is
  953.                                    rejected.   Since  this  operation can
  954.                                    be slow  (invoking another program for
  955.                                    each  path),  it  is  invoked last and
  956.                                    only   if   all   other   tests   have
  957.                                    succeeded.   For   example, if used in
  958.                                    conjunction   with   "-blocks",   only
  959.                                    files  passing the "-blocks" test will
  960.                                    be given to  "-exec".   It  is  recom-
  961.                                    mended that -exec be  used  only  with
  962.                                    some  other  qualifier  to  reduce the
  963.                                    number of  times  the  command must be
  964.                                    called.
  965.  
  966.                                    Programs  invoked from -exec  must  be
  967.                                    specified as a complete path.
  968.  
  969.                       -ver or -v   Prints the version ID of find.
  970.  
  971.             Example:  # list all files under /usr and /misc:
  972.                       find /usr /misc -print
  973.  
  974.                       # list all files under /usr/appl newer than
  975.                       # ram:myfile:
  976.                       find /usr/appl -newer ram:myfile -print
  977.  
  978.                       # list all files under /pd/src ending in  ".h"  and
  979.                       having a non-null file comment:
  980.                       find /pd/src -name '*.h' -comment '?*' -print
  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.                       # run "view -t" on all files under /misc:
  998.                       find /misc -type f -print | while read fspec
  999.                       do
  1000.                          view -t $fspec
  1001.                       done
  1002.  
  1003.                       # another way to do that above:
  1004.                       find /misc -cmd -type f "/bin/view -t %s" >myscr
  1005.                       source myscr
  1006.  
  1007.                       # find all files under /foo bigger than 10000
  1008.                       # bytes, smaller than 50000 bytes, and containing
  1009.                       # the string "blee":
  1010.                       find /foo -print -exec "sys:bin/fgrep blee %s" \
  1011.                            -bigger 10000 -smaller 50000
  1012.  
  1013.             Limits:   In  this  version   of   find,  only  one  of  each
  1014.                       qualifier switch may be given.  For  example,  only
  1015.                       one -name switch can be used.  This limitation  may
  1016.                       be removed in a future version  of  find.  In spite
  1017.                       of this limit, multiple directories  may  still  be
  1018.                       searched.
  1019.  
  1020.             See Also:
  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       External Cmd Reference
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.           ________________________________________________________________
  1064.  
  1065.             Name:     grep
  1066.  
  1067.             Type:     External Command
  1068.  
  1069.             Default:  n/a
  1070.  
  1071.             Usage:    grep -[vxcilns] [-f pfile] [-e] pattern
  1072.                          [ file ... ]
  1073.  
  1074.             Range:    n/a
  1075.  
  1076.             About:    grep  provides a way to search for text patterns in
  1077.                       a set of files.   It  is  similar to, although more
  1078.                       powerful but slower than, fgrep.
  1079.  
  1080.                       grep searches for the  indicated pattern in the in-
  1081.                       dicated set of files, if present, or  the  standard
  1082.                       input, if not.  A  grep  pattern is a limited regu-
  1083.                       lar  expression.   An   explaination of regular ex-
  1084.                       pressions  is  beyond the scope of  this  document;
  1085.                       however, it should be noted that  although they ap-
  1086.                       pear  similar to wildcards, they are much different
  1087.                       (and more powerful).
  1088.  
  1089.                       There are a large  number of options availble which
  1090.                       modify the actions of grep:
  1091.  
  1092.                       -c   Print only a count of  matching lines for each
  1093.                            file.  If the 'v'  option is used with the 'c'
  1094.                            option,  a  count  of  non-matching  lines  is
  1095.                            printed.
  1096.  
  1097.                       -e   Use  the  next  argument as the pattern.  This
  1098.                            is  useful to  search  for  patterns beginning
  1099.                            with a dash.
  1100.  
  1101.                       -f   Use  the  next  argument as a file which  con-
  1102.                            tains  a  one-line  regular expression.  There
  1103.                            can  only  be  one  regular expression in this
  1104.                            version  of  grep, so this option is currently
  1105.                            of  limited use.  However, if grep is extended
  1106.                            to  permit  multiple  expressions, the 'f' op-
  1107.                            tion will become more useful.
  1108.  
  1109.                       -i   Ignore case in the search.   Normally, grep is
  1110.                            case sensitive.
  1111.  
  1112.                       -l   Print only the names of files  which  containg
  1113.                            the given pattern.   This  is  fast;  if  grep
  1114.                            finds  the  pattern  anywhere in the file,  it
  1115.                            will  stop  looking  and  proceed to the  next
  1116.                            file.  This can  save  time  for  large  files
  1117.  
  1118.  
  1119.           SKsh Amiga Shell            Page 17       External Cmd Reference
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.                            where  the  task  is  to  discover which files
  1130.                            contain the given pattern.
  1131.  
  1132.                       -n   Print  the  line  number  before each matching
  1133.                            line.
  1134.  
  1135.                       -s   Print  nothing.    Return an exit  code  of  0
  1136.                            (true) if any  file  contained the regular ex-
  1137.                            pression, or 1 (false) otherwise.
  1138.  
  1139.                       -v   Invert the search.  Lines which  do  not  con-
  1140.                            tain the regular expression are printed.
  1141.  
  1142.                       -x   The  expression must be found at the beginning
  1143.                            of a line.
  1144.  
  1145.             Example:  if grep -s my_pattern my_file
  1146.                       then
  1147.                          echo 'my_file contains my_pattern'
  1148.                       fi
  1149.  
  1150.             Warnings: Patterns  which  contain '*', '.', spaces, or other
  1151.                       special  characters should be quoted to avoid being
  1152.                       interpreted by the shell.
  1153.  
  1154.                       Be  wary  of  the  difference in the 'x' option be-
  1155.                       tween fgrep and grep.
  1156.  
  1157.                       fgrep  often  more  useful than grep because of its
  1158.                       greater speed  and  smaller  size.   This  is  most
  1159.                       noticable  on  fast  devices such as  ram  or  hard
  1160.                       disks.
  1161.  
  1162.             See Also: fgrep
  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:     head
  1198.  
  1199.             Type:     External Command
  1200.  
  1201.             Default:  num = 10
  1202.  
  1203.             Usage:    head [ -num ] [ file ... ]
  1204.  
  1205.             Range:    0 <= num
  1206.  
  1207.             About:    head  prints  the  first  num lines of  each  named
  1208.                       file,  or  the  standard  input  if  no  files  are
  1209.                       indicated.  If  num is not explicitly set, it has a
  1210.                       default value of 10.
  1211.  
  1212.             Example:  head -5 my_file.c my_other_file.c
  1213.  
  1214.             See Also: tail
  1215.  
  1216.           ________________________________________________________________
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  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:     indent
  1264.  
  1265.             Type:     External Command
  1266.  
  1267.             Default:  char = space
  1268.                       num = 4
  1269.  
  1270.             Usage:    indent [ -num ] [ -cchar ] [ file ... ]
  1271.  
  1272.             Range:    n/a
  1273.  
  1274.             About:    Indent  inserts  the  defined character (a space by
  1275.                       default) a given  number of times (4 by default) at
  1276.                       the  beginning  of  every line of a file which does
  1277.                       not  contain only a newline.  That is, empty  lines
  1278.                       are left alone.
  1279.  
  1280.             Example:  indent -5 myfile.txt
  1281.  
  1282.             See Also:
  1283.  
  1284.           ________________________________________________________________
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  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       External Cmd Reference
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.           ________________________________________________________________
  1328.  
  1329.             Name:     join
  1330.  
  1331.             Type:     External Command
  1332.  
  1333.             Default:  n/a
  1334.  
  1335.             Usage:    join [ -a ] source1 [ source2 ... ] destination
  1336.  
  1337.             Range:    n/a
  1338.  
  1339.             About:    The  join command concatinates binary or ASCII data
  1340.                       from  multiple files into a single file, optionally
  1341.                       appending the data to  the  destination file if the
  1342.                       -a flag is set.   The  destination file is the last
  1343.                       one given.
  1344.  
  1345.             Example:  join file1 file2 dest_file
  1346.  
  1347.             See Also:
  1348.  
  1349.           ________________________________________________________________
  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.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.           ________________________________________________________________
  1394.  
  1395.             Name:     num
  1396.  
  1397.             Type:     External Command
  1398.  
  1399.             Default:  num = 4
  1400.  
  1401.             Usage:    num [ -digits ] [ -r ] [ file ... ]
  1402.  
  1403.             Range:    2 <= digits <= 8
  1404.  
  1405.             About:    num prints ASCII files,  prefixing each line in the
  1406.                       file with its  line  number.   By  default, 4 digit
  1407.                       line  numbers are used, but  this  can  be  changed
  1408.                       from 2  to  8  digits numbers with the command line
  1409.                       switch.
  1410.  
  1411.                       Also by  default, num resets the line number at the
  1412.                       beginning of each file.   To  use  consecutive line
  1413.                       numbers for all files, use the "-r"  switch.   With
  1414.                       that  option  selected, the line count is not reset
  1415.                       for each file.
  1416.  
  1417.             Example:  num -6 -r myfile1.c myfile2.c
  1418.  
  1419.             See Also:
  1420.  
  1421.           ________________________________________________________________
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.           SKsh Amiga Shell            Page 22       External Cmd Reference
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.           ________________________________________________________________
  1460.  
  1461.             Name:     srun
  1462.  
  1463.             Type:     External Command
  1464.  
  1465.             Default:  stk = 4000
  1466.                       pri = 0
  1467.  
  1468.             Usage:    srun [ -i file ] [ -o file ] [ -s stk ] [ -p pri ]
  1469.                          program [ args ]
  1470.  
  1471.             Range:    4000 <= stk
  1472.                       -31 <= pri <= 31
  1473.  
  1474.             About:    srun  was  created to overcome certain deficiencies
  1475.                       in the  AmigaDos  run command.  srun is most useful
  1476.                       in  scripts  or  functions, although it can also be
  1477.                       used  from  the  command  line.   It  allows you to
  1478.                       specify  an  input  file,  output file, stack size,
  1479.                       and  priority  for  a  command which is run in  the
  1480.                       background.    Standard  input and output cannot be
  1481.                       re-directed with the AmigaDos  run command (for ex-
  1482.                       ample,  if  standard output is redirected, the out-
  1483.                       put  file  will  contain only "[CLI n]").  The srun
  1484.                       command  is  very  useful in  functions such as the
  1485.                       one  given  below  (very  much  simplified from one
  1486.                       given in the Stuff.sksh file).
  1487.  
  1488.                       The program name given  to  srun must be a complete
  1489.                       path.  This can be obtained in SKsh via:
  1490.  
  1491.                         $(which -s prog)
  1492.  
  1493.                       srun  will  report an  error if it is unable to ex-
  1494.                       ecute  the  program or  unable to open and input or
  1495.                       output file.
  1496.  
  1497.             Example:  function zmore {
  1498.                          srun -o pipe:tmp $(which zoo) -print "$1" "$2"
  1499.                          more pipe:tmp
  1500.                       }
  1501.  
  1502.             See Also: run
  1503.  
  1504.           ________________________________________________________________
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.           SKsh Amiga Shell            Page 23       External Cmd Reference
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.           ________________________________________________________________
  1526.  
  1527.             Name:     strings
  1528.  
  1529.             Type:     External Command
  1530.  
  1531.             Default:  num = 6
  1532.  
  1533.             Usage:    strings [ -num ] [ file ... ]
  1534.  
  1535.             Range:    0 <= num
  1536.  
  1537.             About:    strings searches the named files for strings of  at
  1538.                       least  num  consecutive  printable characters.   If
  1539.                       found, it prints them.   If  num is not set, it de-
  1540.                       faults to 6.
  1541.  
  1542.             Example:  strings -10 my_file.o binary_file
  1543.  
  1544.             See Also:
  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       External Cmd Reference
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  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       External Cmd Reference
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.           ________________________________________________________________
  1658.  
  1659.             Name:     tail
  1660.  
  1661.             Type:     External Command
  1662.  
  1663.             Default:  num = 10, '-' option
  1664.  
  1665.             Usage:    tail [ -num | +num ] [ file ... ]
  1666.  
  1667.             Range:    0 <= num <= 32000
  1668.  
  1669.             About:    tail prints the last  num lines of each named file,
  1670.                       or the  standard input if no files are named.  If a
  1671.                       '+'  precedes  num  instead of a '-',  tail instead
  1672.                       skips num lines and prints the rest of the file.
  1673.  
  1674.                       In  SKsh  1.4,  the  algorithm  used  by  tail  was
  1675.                       changed.  If run on a file, it  will  now  seek  to
  1676.                       the end of the  file  and  read  backwards until it
  1677.                       encounters the proper line.  This means  that  run-
  1678.                       ning  tail on a large file is now nearly  instanta-
  1679.                       neous;  previously, it would  read  in  the  entire
  1680.                       file.
  1681.  
  1682.             Example:  tail -15 my_file.c my_other_file.c
  1683.  
  1684.             See Also: head
  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       External Cmd Reference
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.           ________________________________________________________________
  1724.  
  1725.             Name:     tee
  1726.  
  1727.             Type:     External Command
  1728.  
  1729.             Default:  n/a
  1730.  
  1731.             Usage:    tee [ -a ] [ file ... ]
  1732.  
  1733.             Range:    less than 32 files
  1734.  
  1735.             About:    tee  copies its standard input to its standard out-
  1736.                       put, and also to any named  files.   The  old  con-
  1737.                       tents of the files  are  overwritten unless the ap-
  1738.                       pend (-a) flag is  used.   With  no  arguments, tee
  1739.                       simply copies its input to its output.
  1740.  
  1741.             Example:  fgrep foo my_file | tee save_foo | wc -c
  1742.  
  1743.             See Also:
  1744.  
  1745.           _______________________________________________________________
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  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       External Cmd Reference
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.           ________________________________________________________________
  1790.  
  1791.             Name:     view
  1792.  
  1793.             Type:     External Command
  1794.  
  1795.             Default:  n/a
  1796.  
  1797.             Usage:    see View.doc
  1798.  
  1799.             Range:    n/a
  1800.  
  1801.             About:    view  is  a  command which allows other commands to
  1802.                       be called based on the type of a given  file.   See
  1803.                       the  View.doc manual  for  a  detail description of
  1804.                       this command.
  1805.  
  1806.             Example:  view myfile my_otherfile
  1807.  
  1808.             See Also:
  1809.  
  1810.           ________________________________________________________________
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.           SKsh Amiga Shell            Page 28       External Cmd Reference
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.           ________________________________________________________________
  1856.  
  1857.             Name:     wc
  1858.  
  1859.             Type:     External Command
  1860.  
  1861.             Default:  n/a
  1862.  
  1863.             Usage:    wc [ -hcwlqt ] [ file ... ]
  1864.  
  1865.             Range:    n/a
  1866.  
  1867.             About:    wc is a  utility which counts characters, words, or
  1868.                       lines in a  given  series of files (or the standard
  1869.                       input, if  no  files  are  indicated).  It normally
  1870.                       produces  information on all three counts, preceded
  1871.                       by a title for each column.  If  the  c,  w,  or  l
  1872.                       flags  are  set,  only  information on  characters,
  1873.                       words, or lines is  printed.  (These  can  be  com-
  1874.                       bined;  for  example 'wc -cl').  If the q  flag  is
  1875.                       set,  wc does its work  quietly; that is, it leaves
  1876.                       out titles and file names,  only  reporting the ac-
  1877.                       tual counts.  The t flag can be  used  to  obtain a
  1878.                       total at the end, and the h flag prints  a  helpful
  1879.                       usage message.
  1880.  
  1881.             Example:  if [ $(wc -lq my_file) -lt 10 ]
  1882.                       then
  1883.                          echo "There must be at least 10 lines"
  1884.                       fi
  1885.  
  1886.             See Also:
  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       External Cmd Reference
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.           ________________________________________________________________
  1922.  
  1923.             Name:     window
  1924.  
  1925.             Type:     External Command
  1926.  
  1927.             Default:  n/a
  1928.  
  1929.             Usage:    window [ -back ] [ -front ] [ -title ]
  1930.                          [ -pos [x,y] ] [ -size [x,y] ] [ -scrsize ]
  1931.                          [ -wmouse ] [ -smouse ]
  1932.  
  1933.             Range:    n/a
  1934.  
  1935.             About:    window is a  command which allows parameters of the
  1936.                       current  shell  window to be  modified or examined.
  1937.                       The -back and -front flags cause  the  window to be
  1938.                       sent to the back or front.  The -title flag  causes
  1939.                       the  current  window title to be printed.  The -pos
  1940.                       flag  with  no  following parameters can be used to
  1941.                       find  the  current x and y positions of the window.
  1942.                       With  a  comma  separated set of  numbers, it moves
  1943.                       the  window  to  that  position if possible.  Simi-
  1944.                       larly, the -size  parameter either reports the size
  1945.                       of  the  current  window in  pixels, or resizes the
  1946.                       window to that  size  if  possible.   The  -scrsize
  1947.                       flag  reports  the  current size of the screen con-
  1948.                       taining  this  window, and the -smouse and  -wmouse
  1949.                       flags  report  the  cursor position relative to the
  1950.                       screen or window.
  1951.  
  1952.                       With  no  parameters,  the  window command prints a
  1953.                       helpful  usage message.  Note that this  usage mes-
  1954.                       sage  contains  one  additional option which can be
  1955.                       included  after the -title flag to change the  win-
  1956.                       dow title to  a  set  value.   However, this is not
  1957.                       actually  permitted by  AmigaDos,  and  although it
  1958.                       works now, it  may  cause  problems, and its use is
  1959.                       not recommended.  Use at your own risk.
  1960.  
  1961.             Example:  # move window to back and upper left hand corner
  1962.                       window -back -pos 0,0
  1963.  
  1964.             See Also:
  1965.  
  1966.           ________________________________________________________________
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.           SKsh Amiga Shell            Page 30       External Cmd Reference
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.           ________________________________________________________________
  1988.  
  1989.             Name:     xd
  1990.  
  1991.             Type:     External Command
  1992.  
  1993.             Default:  n/a
  1994.  
  1995.             Usage:    xd [ file ... ]
  1996.  
  1997.             Range:    n/a
  1998.  
  1999.             About:    xd  (hex  dump)  prints  a  hexadecimal dump of  each
  2000.                       named  file,  or  the  standard input if no files are
  2001.                       named.   It  prints  the  hex  address of the current
  2002.                       offset  as  8  digits, then a hex dump  of  16  bytes
  2003.                       separated into groups of 2 bytes, then an ASCII  rep-
  2004.                       resentation of the 16 bytes, or '.' if  the  byte  is
  2005.                       not a printable character.
  2006.  
  2007.             Example:  xd any_old_file
  2008.  
  2009.             See Also:
  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       External Cmd Reference
  2044.  
  2045.  
  2046.  
  2047.