# The function to use in place of the standard "cd"
function selector-cd () {
+ local UMASK=$(umask)
umask 077
if [[ -z "$1" ]]; then
TMP=$(mktemp /tmp/selector-cd.XXXXXX)
tail -$((SELECTOR_CD_HISTORY_SIZE-1)) < "${SELECTOR_CD_HISTORY}" > "${TMP}"
cat "${TMP}" > "${SELECTOR_CD_HISTORY}"
- rm -f "${TMP}"
+ \rm -f "${TMP}"
fi
echo "${PWD}" | sed -e "s!^${HOME}!~!" >> "${SELECTOR_CD_HISTORY}"
+ umask ${UMASK}
}
function selector-cd-search () {
+ local UMASK=$(umask)
umask 077
if [[ -f "${SELECTOR_CD_HISTORY}" ]]; then
else
echo "No cd history file '${SELECTOR_CD_HISTORY}'." >&2
fi
+ umask ${UMASK}
}
alias cd=selector-cd