From 05c18382ee1ab88c47a22f95b659863483377ed4 Mon Sep 17 00:00:00 2001 From: Nicholas Firth-McCoy Date: Fri, 4 Mar 2011 17:50:47 +1100 Subject: [PATCH] Fixed call to mktemp to provide Xs as a template, and forced replacement of old .sdirs file in _purge_line --- bashmarks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bashmarks.sh b/bashmarks.sh index 5f6bfaf..0bf3ec6 100644 --- a/bashmarks.sh +++ b/bashmarks.sh @@ -133,12 +133,12 @@ function _compzsh { function _purge_line { if [ -s "$1" ]; then # safely create a temp file - t=$(mktemp -t bashmarks) || exit 1 + t=$(mktemp -t bashmarksXXXXXXXX) || exit 1 trap "rm -f -- '$t'" EXIT # purge line sed "/$2/d" "$1" > "$t" - mv "$t" "$1" + mv -f "$t" "$1" # cleanup temp file rm -f -- "$t"