diff --git a/realpath.sh b/realpath.sh index 8898066..75d9e58 100755 --- a/realpath.sh +++ b/realpath.sh @@ -8,4 +8,4 @@ case "$target" in *) p="${p%/*}/$target";; esac -printf "%s\n" "$p"|sed -e 's@/[^/]*/\.\.\(/\|$\)@/@g' -e 's|/\.\(/\|$\)|/|g' -e 's|/$||g' +printf "%s\n" "$p"|sed -e 's@/[^/]*/\.\.\(/\|$\)@/@g' -e 's|/\.\(/\|$\)|/|g' -e 's|/$||g' -e '/^$/d'