From: Francois Fleuret Date: Fri, 11 Nov 2011 21:45:59 +0000 (+0100) Subject: Fixed the substitution of HOME. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=a01943060785bb070dc793818dcd2219c68a5672;p=selector.git Fixed the substitution of HOME. --- 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} }