--- /dev/null
+#! /bin/sh
+
+if [ $# -lt 2 ]; then
+ echo "Usage: $0 directory1 directory2"
+ exit 1
+fi
+if [ -d "$1" -a -d "$2" ]; then
+ echo "$0: start comparing '$1' and '$2'" >&2
+fi
+
+list=`mktemp --tmpdir cmpdir.list.XXXXXXXXXX` || exit 1
+tmp=`mktemp --tmpdir cmpdir.tmp.XXXXXXXXXX` || exit 1
+trap "rm -- '$list' '$tmp'" EXIT
+
+wc=$PWD
+cd "$1"
+find ./ -print0 >> "$tmp"
+cd $wc
+
+cd "$2"
+find ./ -print0 >> "$tmp"
+cd $wc
+
+sort -z "$tmp" | uniq -z > "$list"
+
+comppath () {
+ [ ! -e "$1/$3" ] && [ ! -e "$2/$3" ] &&
+ (echo "$0: something wrong abount '$3'" >&2; return)
+ [ -e "$1/$3" ] && [ ! -e "$2/$3" ] &&
+ (echo "Only in '$1': '$3'" >&2; return)
+ [ ! -e "$1/$3" ] && [ -e "$2/$3" ] &&
+ (echo "Only in '$2': '$3'" >&2; return)
+}
+
+xargs -a "$list" -0 -n 1 -I entry cmp "$1/entry" "$2/entry"