X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=selector.git;a=blobdiff_plain;f=bash-selector.sh;fp=bash-selector.sh;h=dc7373b801008a2b52f532209ad465885bb91918;hp=7cb749ccaef9db675ea46a66701e030341e72a3a;hb=106d4dc2138483e208cb8955d6f6f32a7915839b;hpb=7da4fa536d891d9ec63423b23d28f436a94ebdc7 diff --git a/bash-selector.sh b/bash-selector.sh index 7cb749c..dc7373b 100755 --- a/bash-selector.sh +++ b/bash-selector.sh @@ -72,8 +72,8 @@ function selector-cd () { if [[ -f "${SELECTOR_CD_HISTORY}" ]]; then TMP=$(mktemp /tmp/selector-cd.XXXXXX) - tail -$((SELECTOR_CD_HISTORY_SIZE-1)) < "${SELECTOR_CD_HISTORY}" > "${TMP}" - cat "${TMP}" > "${SELECTOR_CD_HISTORY}" + tail -$((SELECTOR_CD_HISTORY_SIZE-1)) < "${SELECTOR_CD_HISTORY}" > "${TMP}" && \ + cat "${TMP}" > "${SELECTOR_CD_HISTORY}" \rm -f "${TMP}" fi