CLASSIFY
Section: User Commands (1)
Updated: 25 Nov 1991
Index
Return to Main Contents
NAME
classify - group files that are identical (modulo whitespace)
SYNOPSIS
classify
[
-s
|
-l
|
-1
|
-m
|
-M
]
[
-b
|
-w
]
[
-f
]
[
--
|
-
]
filename1 filename2
[
filename3...
]
DESCRIPTION
Classify
is a program designed to help manage a set of files such as the
/etc/rc.local or /etc/motd files for a collection of diskless
workstations.
Classify
examines each of the files named in its arguments, groups
them into
classes,
with files that are almost identical in
the same class, and files that are not very much alike in
different classes, and outputs a brief report. For example:
sterno napalm
moe larry curly
holy_grail
This output indicates that files
sterno and napalm
are identical in content, that
moe, larry, and curly
are all three the same as each other but different from
sterno and napalm,
and that
holy_grail
is different from all the others.
The other function of
classify
is to produce a list of files which are almost the same as a
single other file.
Classify
ignores files which it cannot open for whatever reason,
continuing on its way.
OPTIONS
- -l
-
Select long output form. This format is unnecessary, but is still around
for convenience and hystorical reasons. The `long' form of the example
output above is:
Class 1:
sterno
napalm
Class 2:
moe
larry
curly
Class 3:
holy_grail
- -s
-
Select short output form: Print the names of the files in
each class together on a single line. This is the default. See the
example above.
- -1
-
Select very short output form: Print on the standard
output the name of only one file
from each class.
- -M
-
Produce on the standard output a list of all the
filenames
which are identical in content to
filename1.
- -m
-
Like
-M,
but omit
filename1
itself from the output.
- -b
-
Ignore blanks and tabs when comparing the named files.
- -w
-
Ignore blanks, tabs, and newline characters when comparing
files.
- -f
-
Fold in lower case. Treat upper- and lower- case letters
equally when comparing files.
- -
-
- --
-
Treat the following arguments as filenames so that you can
specify filenames starting with a `-' character.
- -h
-
Print summary of correct usage.
If more than one of
-l, -s, -1,
-M,
or
-m
is selected, all but the last one on the command line will
be ignored.
EXAMPLES
To edit one /etc/motd from each class and then update the
others.
foreach i (`classify -1 /export/root/*/etc/motd`)
set ifamily=`classify -m $i /export/root/*/etc/motd`
vi $i
foreach j ($ifamily)
cp $i $j
end
end
SEE ALSO
cmp(1),
diff(1)
DIAGNOSTICS
- Couldn't open file filename
-
Indicates that file
filename
does not exist, or that read priviledges are lacking.
- Unknown option: -option
-
AUTHOR
Mark-Jason Dominus, University of Pennsylvania
BUGS
Classify
should be able to read the standard input as one of the
files.
Several performance improvements might be possible.
Classify
becomes confused if one of the files it is classifgying is removed
before it is finished.
The
-l
option is silly since its function can be duplicated with an
awk
script.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- EXAMPLES
-
- SEE ALSO
-
- DIAGNOSTICS
-
- AUTHOR
-
- BUGS
-
This document was created by
man2html,
using the manual pages.
Time: 06:19:14 GMT, December 12, 2024