forked from simsong/bulk_extractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lgcomp.sh
executable file
·34 lines (26 loc) · 858 Bytes
/
lgcomp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash -ex
TDIR=lgtest
GITHASH=`git rev-parse --short HEAD`
ODIR=$TDIR/out
mkdir -p $TDIR
export LD_LIBRARY_PATH=/usr/local/lib
#OPTS="-j 1"
src/bulk_extractor -x accts_lg -x base16_lg -x email_lg -x gps_lg -x lightgrep -o $ODIR $OPTS $1
mv $ODIR $TDIR/${GITHASH}
src/bulk_extractor -x accts -x base16 -x email -x gps -o $ODIR $OPTS $1
mv $ODIR $TDIR/${GITHASH}_lg
CMPDIR=$TDIR/${GITHASH}_cmp
mkdir $CMPDIR
mkdir $CMPDIR/plus
mkdir $CMPDIR/minus
for i in `find $TDIR/$GITHASH -name '*.txt' ! -name '*_histogram.txt' ! -name 'url_services.txt' -exec basename \{\} \;`; do
A=`mktemp`
B=`mktemp`
sort $TDIR/$GITHASH/$i >$A
sort $TDIR/${GITHASH}_lg/$i >$B
comm -1 -3 $A $B >$CMPDIR/plus/$i
comm -2 -3 $A $B >$CMPDIR/minus/$i
rm $A $B
[ -s $CMPDIR/plus/$i ] || rm $CMPDIR/plus/$i
[ -s $CMPDIR/minus/$i ] || rm $CMPDIR/minus/$i
done