#!/bin/sh
DIR1=$1
DIR2=$2
echo "cmp '$DIR1' '$DIR2'"
main() {
if [ ! -d "$DIR1" -o ! "$DIR1" -o ! -d "$DIR2" -o ! "$DIR2" ]; then
return 1
fi
DIR=`pwd`
cd "$DIR1"
FILES=`find`
cd "$DIR"
for FILE in ${FILES[@]}; do
if [ -f "$DIR1/$FILE" ]; then
cmp "$DIR1/$FILE" "$DIR2/$FILE"
fi
done
return 0
}
main $@ || exit $?
使うときは