#!/bin/bash runs="$1" if [ -z "${runs}" ]; then runs=$(cat RUNS); fi for run in $runs; do for pos in upos xpos none; do team=${run%%/*}; id=${run##*/}; for key in "^Full negation:" "^Scopes\(cue match\):" "^Negated\(no cue match\):"; do if [ "${key}" != "${key%%negation:}" ]; then suffix="full"; elif [ "${key}" != "${key##^Scopes}" ]; then suffix="scopes"; else suffix="events"; fi egrep "${key}" ${run}/negation/development/sherlock/${pos}-*/score | sort -nr -t \| -k 8 > ${run}.${pos}.${suffix} done done done