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 >
Wrap
Text File
|
1979-12-31
|
7KB
|
199 lines
PC Tools
5-17-85 Chuck Allison
602-742-2448
Summary_______ of__ PC__ Tools_____
The programs included on this diskette have been found to be
useful tools in program development, document generation and file
maintenance. They were developed on a Sanyo MBC-555-2 with the
Mark Williams MWC86 Compiler. I used the file expansion
capabilities of that compiler, rather than mess with a FINDFIRST -
FINDNEXT scheme. Also, in the case of GREP, I used the
command-line as supplied by Mark Williams C to process quoted
arguments (see grep2.doc). Other than this, the source should be
fairly portable.
Unless otherwise noted, all file specifications below can include
wildcards, for example, *.bak, test.*, a??.??b , etc. Most of the
programs send their output to the screen (standard output), but
output can be redirected to a file (e.g., >file.out) or to the
printer (>prn). Letters following minus signs are options
(sometimes called switches) that affect the output. For example,
in the print facility pr, the letter l causes line numbers to be
printed with the output, so you would enter pr -l file >prn. If
you don't want line numbers, just type pr file >prn. Unless
switches require an associated number, they can be combined, as in
wc -lcf *.c >prn. In the explanations below, optional entries are
placed in [brackets].
These tools also act as filters, so the indicated filenames are
optional, and output from one program can become input to another
in a pipe, as in
cat file1 file2 | pr -l >prn .
--------
Description___________ of__ PC__ Tools_____
calc
..a simple on-line adding machine. Enter commands as
"number operation" (e.g., 2 +). Does +,-, *, /, s
(set accumulator), e (end). See code (calc.c)..
cat file1 file2 ...
..concatenates (combines into one file) several files..
darken [-#] file1 file2 ...
..overstrikes each line of files # times (default 3)..
grep [-cfinv] pat file1 file2 ...
..prints lines containing substrings matching the
regular expression pat (must be quoted to embed a space) -
Page 1
PC Tools
-c -> only give a count of matching lines
-f -> flip file switch (print filename if > 1 file)
-i -> ignore case in pattern matching
-n -> print line numbers with each line
-v -> report non-matching lines..
head [-#] file1 file2 ...
..prints the first # (5 default) lines of files; for quick
inspection..
page file1 file2 ...
..displays files one screen at a time; to skip to the next
file, press 'n'; to scroll just one more line, press RETURN;
to quit press 'q'; any other keypress will give the next
screen of the current file; the filename of the current file
is displayed at the start of the file..
pr [-lh] [-t#] [-n#] file1 file2 ...
..prints text files with margins and with a header that
includes filename, date, time, and page number;
-l -> print with line numbers (default off)
-h -> omit heading (default on)
-t# -> interpret tabs as # spaces (default 4)
-n# -> print # lines per page (default 55)
(switches t and n must each stand as separate arguments)..
roff file1 file2 ...
..yet another roff! I've streamlined the code (it's readable
now, and much shorter). Files on command line are combined
as if one file. Prints to standard output. Leading spaces
in headers and footers are significant.
rm [-g] file1 file2 ... (not a filter)
..selectively delete files; prompts the user for each file
with these options:
y -> yes, delete this file
n -> no, keep this file
p -> peek, let me see a few (5) lines first
g -> go, delete the rest without asking
q -> quit, leave rm
..using the -g switch on the command line invokes "go"
mode, so no prompting is done, but the deletions are still
reported..
uniq file1 file2 ...
..deletes adjacent, duplicate lines; useful after sorting..
uniq2 file1 file2 ...
..deletes duplicates even if not sorted (does an index
sort, marks lines for deletion, then prints unmarked lines).
This isn't perfected (requires time and space - don't try
on a full disk)..
wc [-lwcf] file1 file2 ...
.."word count": gives the number of lines, words and char-
Page 2
PC Tools
acters in text files (all three by default, or choose sep-
arately with switches); the -f option flips the file switch,
which normally prints filenames with multiple file requests
and omits it when only one file is requested..
xref file (one file only; no wildcards)
..prints an alphabetical cross-reference listing of words,
giving which lines each word is found on in the file; cur-
rently it doesn't paginate its output, so I would suggest
the command xref file | pr -h ..
--------
"rm" and "page" use reverse video, so you may need to boot up with
"ansi.sys". "rm" and "roff" are not filters. I've thrown a few
extra source modules in for fun (hash.c, include.c, ...). Read
their comments.
Page 3