From a0f58616ecdbc3c36ab053ae1bd0326f5c2d1f58 Mon Sep 17 00:00:00 2001 From: rupa Date: Wed, 3 Aug 2011 16:13:15 -0400 Subject: [PATCH] use a case statement rather than a bash substring, for portability --- z.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/z.sh b/z.sh index d75d4cb..d51c543 100755 --- a/z.sh +++ b/z.sh @@ -98,8 +98,10 @@ _z() { [ "$fnd" ] || local list=1 # if we hit enter on a completion just go there - # completions will always start with / - [ -z "$list" -a -d "$last" -a "${last:0:1}" = "/" ] && cd "$last" && return + case "$last" in + # completions will always start with / + /*) [ -z "$list" -a -d "$last" ] && cd "$last" && return;; + esac # no file yet [ -f "$datafile" ] || return