#!/bin/sh readonly MATCH_FOUND=1 readonly BASE_DIR="$(dirname $0)" readonly MATCHER="$BASE_DIR/../src/pcap-matcher/pcap-matcher" readonly OUTFILE="$BASE_DIR/keylog-matchings.txt" for k in "$BASE_DIR"/keylogs/*/*/*.log; do printf "%s " "$k" seq 2 15 | while read i; do if "$MATCHER" -t $i -l 250 "$k" flows/*.pcap; then return $MATCH_FOUND fi done 2> /dev/null if [ $? -ne $MATCH_FOUND ]; then echo "No flow file found for $k" 1>&2 printf "\n" # Create empty line for log to represent no match found. fi done > "$OUTFILE"