|
NAMErwcompare - Compare the records in two SiLK Flow filesSYNOPSISrwcompare [--quiet] [--site-config-file] FILE1 FILE2 rwcompare --help rwcompare --version DESCRIPTIONrwcompare opens the two files named on the command and compares the SiLK Flow records they contain. If the records are identical, rwcompare exits with status 0. If any of the records differ, rwcompare prints a message and exits with status 1. If there is an issue reading either file, an error is printed and the exit status is 2. Use the --quiet switch to suppress all output (error messages included). You may use "-" or "stdin" for one of the file names, in which case rwcompare reads from the standard input.OPTIONSOption names may be abbreviated if the abbreviation is unique or is an exact match for an option. A parameter to an option may be specified as --arg=param or --arg param, though the first form is required for options that take optional parameters.
EXAMPLESIn the following examples, the dollar sign ($) represents the shell prompt. Some input lines are split over multiple lines in order to improve readability, and a backslash (\) is used to indicate such lines. The examples assume the existence of the file data.rw that contains SiLK Flow records. The exit status of the most recent command is available in the shell variable $?.Compare a file with itself: $ rwcompare data.rw data.rw $ echo $? 0 Compare a file with itself, where one instance of the file is read from the standard input: $ rwcat data.rw | rwcompare - data.rw $ echo $? 0 Use rwsort(1) to modify one instance of the file and compare the results: $ rwsort --fields=proto data.rw | rwcompare - data.rw - data.rw differ: record 1 $ echo $? 1 Run the command again and use the --quiet switch: $ rwsort --fields=proto data.rw | rwcompare --quiet - data.rw $ echo $? 1 Compare the file with input containing two copies of the file: $ rwcat data.rw data.rw | rwcompare data.rw - data.rw - differ: EOF data.rw $ echo $? 1 Compare the file with /dev/null: $ rwcompare --quiet /dev/null data.rw $ echo $? 2 rwcompare checks whether two files have the same records in the same order. To compare two arbitrary files, use rwsort(1) to reorder the records. Make certain to provide enough fields to the rwsort command so that the records are in the same order. $ rwsort --fields=1-10,12-15,20-29 data.rw > /tmp/sorted-data.rw $ rwsort --fields=1-10,12-15,20-29 other-data.rw \ | rwcompare /tmp/sorted-data.rw - /tmp/sorted-data.rw - differ: record 103363 ENVIRONMENT
FILES
SEE ALSOrwfileinfo(1), rwcat(1), rwsort(1), silk(7)
Visit the GSP FreeBSD Man Page Interface. |