From a01943060785bb070dc793818dcd2219c68a5672 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Fri, 11 Nov 2011 22:45:59 +0100 Subject: [PATCH] Fixed the substitution of HOME. --- bash-selector.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash-selector.sh b/bash-selector.sh index 653afc1..3a478f6 100755 --- a/bash-selector.sh +++ b/bash-selector.sh @@ -54,7 +54,7 @@ function selector-cd () { fi TMP=$(mktemp /tmp/selector-cd.XXXXXX) tail -1000 < ${SELECTOR_CD_HISTORY} > ${TMP} - echo $PWD | sed -e "s!${HOME}!~!" >> ${TMP} + echo $PWD | sed -e "s!^${HOME}!~!" >> ${TMP} cat ${TMP} > ${SELECTOR_CD_HISTORY} rm -f ${TMP} } @@ -64,7 +64,7 @@ function selector-cd-search () { selector -u -t "cd" -l 10000 -d -i -c 7,2,0,3 -o ${PATH_TEMP} -q ${SELECTOR_CD_HISTORY} NEW_PATH="$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')" if [[ -s "${NEW_PATH}" ]]; then - selector-cd "$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')" + selector-cd "$(cat ${PATH_TEMP} | sed -e 's!^~!'${HOME}'!')" fi \rm ${PATH_TEMP} } -- 2.39.5