home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 154_01 / read.me < prev    next >
Text File  |  1979-12-31  |  7KB  |  199 lines

  1.  
  2.    PC Tools
  3.  
  4.  
  5.  
  6.     5-17-85                                             Chuck Allison
  7.     602-742-2448
  8.     
  9.     
  10.     
  11.                            Summary_______ of__ PC__ Tools_____
  12.     
  13.     
  14.     
  15.     The  programs  included  on  this  diskette  have been found to be
  16.     useful tools in program development, document generation and  file
  17.     maintenance.  They  were  developed  on a Sanyo MBC-555-2 with the
  18.     Mark  Williams  MWC86  Compiler.  I  used   the   file   expansion
  19.     capabilities of that compiler, rather than mess with a FINDFIRST -
  20.     FINDNEXT   scheme.   Also,  in  the  case  of  GREP,  I  used  the
  21.     command-line as supplied by Mark  Williams  C  to  process  quoted
  22.     arguments  (see  grep2.doc). Other than this, the source should be
  23.     fairly portable.
  24.     
  25.     Unless otherwise noted, all file specifications below can  include
  26.     wildcards,  for example, *.bak, test.*, a??.??b , etc. Most of the
  27.     programs send their output to the screen  (standard  output),  but
  28.     output  can  be  redirected  to a file (e.g., >file.out) or to the
  29.     printer  (>prn).  Letters  following  minus  signs   are   options
  30.     (sometimes  called  switches) that affect the output. For example,
  31.     in the print facility pr, the letter l causes line numbers  to  be
  32.     printed  with  the  output, so you would enter pr -l file >prn. If
  33.     you don't want line  numbers,  just  type  pr  file  >prn.  Unless
  34.     switches require an associated number, they can be combined, as in
  35.     wc  -lcf *.c >prn. In the explanations below, optional entries are
  36.     placed in [brackets].
  37.     
  38.     These tools also act as filters, so the  indicated  filenames  are
  39.     optional,  and output from one program can become input to another
  40.     in a pipe, as in
  41.                   cat  file1 file2 | pr -l >prn     .
  42.     --------
  43.     
  44.                          Description___________ of__ PC__ Tools_____
  45.     
  46.     
  47.             calc
  48.                   ..a simple on-line adding machine.  Enter commands as
  49.                   "number operation" (e.g., 2 +).  Does +,-, *, /, s
  50.               (set accumulator), e (end).  See code (calc.c)..
  51.     
  52.             cat file1 file2 ...
  53.                   ..concatenates (combines into one file) several files..
  54.     
  55.     
  56.             darken [-#] file1 file2 ...
  57.                   ..overstrikes each line of files # times (default 3)..
  58.     
  59.             grep [-cfinv] pat file1 file2 ...
  60.                   ..prints lines containing substrings matching the
  61.                   regular expression pat (must be quoted to embed a space) -
  62.  
  63.  
  64.    Page 1
  65.  
  66.  
  67.  
  68.    PC Tools
  69.  
  70.  
  71.  
  72.                     -c    ->    only give a count of matching lines
  73.                     -f    ->    flip file switch (print filename if > 1 file)
  74.                     -i    ->    ignore case in pattern matching
  75.                     -n    ->    print line numbers with each line
  76.                     -v    ->    report non-matching lines..
  77.     
  78.             head [-#] file1 file2 ...
  79.                   ..prints the first # (5 default) lines of files;  for quick 
  80.                  inspection..
  81.     
  82.             page file1 file2 ...
  83.                   ..displays files one screen at a time;  to skip to the next 
  84.                  file, press 'n'; to scroll just one more line, press RETURN; 
  85.                  to  quit press 'q';  any other keypress will give  the  next 
  86.                  screen of the current file; the filename of the current file 
  87.                  is displayed at the start of the file..
  88.     
  89.             pr [-lh] [-t#] [-n#] file1 file2 ...
  90.                   ..prints  text  files with margins and with a  header  that 
  91.                  includes filename, date, time, and page number;
  92.                       -l  ->    print with line numbers (default off)
  93.                       -h  ->    omit heading (default on)
  94.                       -t# ->    interpret tabs as # spaces (default 4)
  95.                       -n# ->    print # lines per page (default 55)
  96.                  (switches t and n must each stand as separate arguments)..
  97.     
  98.             roff file1 file2 ...
  99.                  ..yet another roff!  I've streamlined the code (it's readable
  100.                  now, and much shorter).  Files on command line are combined
  101.                  as if one file.  Prints to standard output.  Leading spaces
  102.                  in headers and footers are significant. 
  103.     
  104.     
  105.             rm [-g] file1 file2 ...       (not a filter)
  106.                   ..selectively delete files;  prompts the user for each file 
  107.                  with these options:
  108.                       y   ->    yes, delete this file
  109.                       n   ->    no, keep this file
  110.                       p   ->    peek, let me see a few (5) lines first
  111.                       g   ->    go, delete the rest without asking
  112.                       q   ->    quit, leave rm
  113.                    ..using  the  -g switch on the command line  invokes  "go" 
  114.                  mode,  so no prompting is done,  but the deletions are still 
  115.                  reported..
  116.     
  117.             uniq file1 file2 ...
  118.                        ..deletes adjacent, duplicate lines; useful after sorting..
  119.     
  120.             uniq2 file1 file2 ...
  121.                        ..deletes duplicates even if not sorted (does an index
  122.                        sort, marks lines for deletion, then prints unmarked lines).
  123.                        This isn't perfected (requires time and space - don't try
  124.                        on a full disk)..
  125.     
  126.             wc [-lwcf] file1 file2 ...
  127.                        .."word count":  gives the number of lines, words and char-
  128.  
  129.  
  130.    Page 2
  131.  
  132.  
  133.  
  134.    PC Tools
  135.  
  136.  
  137.  
  138.                       acters in text files (all three by default,  or choose  sep-
  139.                       arately with switches); the -f option flips the file switch,
  140.                       which normally prints filenames with multiple file requests
  141.                       and omits it when only one file is requested..
  142.     
  143.             xref file      (one file only; no wildcards)
  144.                   ..prints  an alphabetical cross-reference listing of  words, 
  145.                  giving which lines each word is found on in the  file;  cur-
  146.                  rently  it doesn't paginate its output,  so I would  suggest 
  147.                  the command  xref file | pr -h ..
  148.     
  149.     --------
  150.     
  151.     "rm" and "page" use reverse video, so you may need to boot up with
  152.     "ansi.sys". "rm" and "roff" are not filters.  I've  thrown  a  few
  153.     extra  source  modules  in  for fun (hash.c, include.c, ...). Read
  154.     their comments.
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  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.  
  196.    Page 3
  197.  
  198.  
  199.