diff --git a/tools/rel.sh b/tools/rel.sh index 2079c7052..466b1f485 100755 --- a/tools/rel.sh +++ b/tools/rel.sh @@ -2,6 +2,6 @@ from=${1} to=${2} -common=`printf '%s\0%s' "${from}" "${to}" | sed 's/\(.*\).*\x0\1.*/\1/' | sed 's@/[^/]*$@/@'` +common=`printf '%s\n%s' "${from}" "${to}" | sed 'N;s/\(.*\).*\n\1.*$/\1/' | sed 's@/[^/]*$@/@'` prefix=`printf '%s\n' ${from#$common} | sed 's@[^/][^/]*@..@g'` printf '%s\n' "$prefix/${to#$common}"