kusano 7d535a
#! /bin/sh
kusano 7d535a
set -e
kusano 7d535a
kusano 7d535a
#
kusano 7d535a
# usage: util/overlap.sh [directory]
kusano 7d535a
#
kusano 7d535a
# This script runs the overlap example program on a complete directory tree.
kusano 7d535a
#
kusano 7d535a
# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
#
kusano 7d535a
kusano 7d535a
OVERLAP="overlap"
kusano 7d535a
test -x ./examples/overlap && OVERLAP="./examples/overlap"
kusano 7d535a
test -x ./overlap.exe && OVERLAP="./overlap.exe"
kusano 7d535a
kusano 7d535a
dir="${*-.}"
kusano 7d535a
kusano 7d535a
TMPFILE="/tmp/lzo_$$.tmp"
kusano 7d535a
rm -f $TMPFILE
kusano 7d535a
(find $dir/ -type f -print0 > $TMPFILE) || true
kusano 7d535a
kusano 7d535a
cat $TMPFILE | xargs -0 -r $OVERLAP
kusano 7d535a
kusano 7d535a
rm -f $TMPFILE
kusano 7d535a
echo "Done."
kusano 7d535a
exit 0
kusano 7d535a