From 3300587c6bef99f6504f4bacb147e5d9ab315e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 7 Oct 2013 14:18:36 +0200 Subject: [PATCH] strip initial `-` from the name of shell process Avoids the case where shell detection would result in `basename "-bash"` invocation, triggering the error: basename: illegal option -- b fixes #462 --- libexec/rbenv-init | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 29f7512a..dcb1bd5a 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -23,6 +23,7 @@ done shell="$1" if [ -z "$shell" ]; then shell="$(ps c -p $(ps -p $$ -o 'ppid=' 2>/dev/null) -o 'comm=' 2>/dev/null || true)" + shell="${shell##-}" shell="$(basename "${shell:-$SHELL}")" fi