Commit 795e5aee by Sam Stephenson

Merge pull request #9 from mudge/patch-1

Solaris doesn't come with readlink so use greadlink if available instead.
parents b1d097a8 c6a552e7
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
set -E set -E
exec 3<&2 # preserve original stderr at fd 3 exec 3<&2 # preserve original stderr at fd 3
resolve_link() {
$(type -p greadlink readlink | head -1) $1
}
abs_dirname() { abs_dirname() {
local cwd="$(pwd)" local cwd="$(pwd)"
local path="$1" local path="$1"
...@@ -10,7 +14,7 @@ abs_dirname() { ...@@ -10,7 +14,7 @@ abs_dirname() {
while [ -n "$path" ]; do while [ -n "$path" ]; do
cd "${path%/*}" cd "${path%/*}"
local name="${path##*/}" local name="${path##*/}"
path="$(readlink "$name" || true)" path="$(resolve_link "$name" || true)"
done done
pwd pwd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment