Use parameter expansion for basename + dirname

These are built-ins, and they're used elsewhere in the code.
This commit is contained in:
Peter Aronoff 2011-08-03 20:04:42 -04:00
parent b6ebc2f08b
commit 67d3d6b12d

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