From 67d3d6b12ddc3d00d3ca3846d360d0cb665bf497 Mon Sep 17 00:00:00 2001 From: Peter Aronoff Date: Wed, 3 Aug 2011 20:04:42 -0400 Subject: [PATCH] Use parameter expansion for basename + dirname These are built-ins, and they're used elsewhere in the code. --- libexec/rbenv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rbenv b/libexec/rbenv index 31a2d242..66d8c438 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -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