X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=bash-selector.sh;h=661d4f0215da4feff9aea7ad38d7d65f021567d3;hb=d611b4c925dfabc7427a9e161c30b97575d1acd1;hp=7cb749ccaef9db675ea46a66701e030341e72a3a;hpb=7da4fa536d891d9ec63423b23d28f436a94ebdc7;p=selector.git diff --git a/bash-selector.sh b/bash-selector.sh index 7cb749c..661d4f0 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