#!/bin/sh if [ $# -lt 2 ] ; then echo "compare -- count number of equal neighboring lines" >&2 echo "Usage: ${0##*/} CANDIDATE COMPARISONS..." >&2 exit 1 fi f="$1" shift for i do ./compare-11 "$f" "$i" done | awk '{sum+=$0} END{print sum}'