zeek/testing/scripts/diff-remove-file-ids
Daniel Thayer 6f1e07f6d5 Fixed some test canonifiers to read only from stdin
Fixed some test canonifier scripts to read from stdin instead of
from a filename specified as a cmd-line argument.  This is needed
in order to be able to reliably use them in a pipeline with other
test canonifiers.

Also removed some unused test canonifier scripts.
2015-09-18 17:30:26 -05:00

32 lines
505 B
Bash
Executable file

#! /usr/bin/env bash
#
# A diff canonifier that removes all file IDs from files.log
awk '
BEGIN {
FS="\t";
OFS="\t";
process = 0;
}
$1 == "#path" && $2 == "files" {
process = 1;
}
process && column1 > 0 && column2 > 0 {
$column1 = "XXXXXXXXXXX";
$column2 = "XXXXXXXXXXX";
}
/^#/ {
for ( i = 0; i < NF; ++i ) {
if ( $i == "fuid" )
column1 = i - 1;
if ( $i == "parent_fuid" )
column2 = i - 1;
}
}
{ print }
'