GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  RWCOMPARE (1)

.ds Aq ’

NAME

rwcompare - Compare the records in two SiLK Flow files

CONTENTS

SYNOPSIS



  rwcompare [--quiet] FILE1 FILE2

  rwcompare --help

  rwcompare --version



DESCRIPTION

rwcompare 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.

OPTIONS

Option 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.
--quiet Do not print a message if the files differ, and do not an print error message if a file cannot be opened or read.
--help Print the available options and exit.
--version Print the version number and information about how SiLK was configured, then exit the application.

EXAMPLES

In 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



SEE ALSO

rwfileinfo(1), rwcat(1), rwsort(1), silk(7)
Search for    or go to Top of page |  Section 1 |  Main Index


SiLK 3.11.0.1 RWCOMPARE (1) 2016-04-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.