Merge pull request #11 from telemachus/param-expansion
Use parameter expansion for basename + dirname
This commit is contained in:
commit
c3089c8439
@ -5,8 +5,8 @@ abs_dirname() {
|
|||||||
local path="$1"
|
local path="$1"
|
||||||
|
|
||||||
while [ -n "$path" ]; do
|
while [ -n "$path" ]; do
|
||||||
cd "$(dirname "$path")"
|
cd "${path%/*}"
|
||||||
local name="$(basename "$path")"
|
local name="${path##*/}"
|
||||||
path="$(readlink "$name" || true)"
|
path="$(readlink "$name" || true)"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user