diff_no_links 620 Bytes
#!/bin/sh

function diff_no_links() {
	local FIND="/usr/bin/find"
	local SED="/bin/sed"
	local CAT="/bin/cat"
	local TR="/usr/bin/tr"
	local SORT="/usr/bin/sort"

	local SRC=$1
	local DST=$2

	local SRC_SYMS="${FIND} \"${SRC}\" -type l -exec basename {} \;"
	local DST_SYMS="${FIND} \"${DST}\" -type l -exec basename {} \;"
	local ALL_SYMS="${CAT} <(${SRC_SYMS}) <($DST_SYMS) | ${SORT} -u"

	local EXCLUDES="${ALL_SYMS} | ${SED} 's/^/ -x /' | ${TR} -d '\n'"

	diff -Naur `eval ${EXCLUDES}` "${SRC}" "${DST}"
	return $?
}

test "X$(basename -- "$0")" = "Xdiff_no_links" && diff_no_links "$@"

# vim: set ft=sh ts=4 sw=4: