Merge pull request #11 from telemachus/param-expansion

Use parameter expansion for basename + dirname
This commit is contained in:
Sam Stephenson 2011-08-03 17:57:52 -07:00
commit c3089c8439

View file

@ -5,8 +5,8 @@ abs_dirname() {
local path="$1"
while [ -n "$path" ]; do
cd "$(dirname "$path")"
local name="$(basename "$path")"
cd "${path%/*}"
local name="${path##*/}"
path="$(readlink "$name" || true)"
done