#!/bin/sh
for A in "$1" "$2"; do
	[ -d "$A" ] || . fail does not exist: "$A"
done

temp=`temp`

( pushd "$1" >/dev/null 2>&1 ; find -type f ; popd >/dev/null 2>&1 ; pushd "$2" >/dev/null 2>&1 ; find -type f ) | LC_ALL=C sort -u >"$temp"
#tee /dev/stderr >"$temp"

fail=0
while read A; do
	if cmp -- "$1"/"$A" "$2"/"$A"; then
		:
	else
		if [ -n "$quick" ]; then
			exit 1
		else
			fail=1
		fi
	fi
done <"$temp"
rm "$temp"
exit $fail
