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

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