From d6a30184c62617e95ddfa54e6f2eed1b7c4f8b74 Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Wed, 31 Aug 2016 12:30:41 +0300 Subject: [PATCH] shred instead of rm --- vim/vimcrypted | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vim/vimcrypted b/vim/vimcrypted index 0cd9528..0588031 100755 --- a/vim/vimcrypted +++ b/vim/vimcrypted @@ -18,6 +18,8 @@ Changed file is always backed up as .old } [[ -z "$1" ]] && helpexit [[ "$1" = "-h" ]] && helpexit +RM=rm +which shred &> /dev/null && RM="shred -u" set -x if [[ ! "$1" == *\.gpg ]] then @@ -40,7 +42,7 @@ edit=`date +%s -r $unc` if [ -s "$unc" ] then vim -i NONE -n "$unc" else echo Error in decrypting - rm "$unc" + $RM "$unc" exit 1 fi @@ -54,4 +56,4 @@ then mv -f "$1".tmp "$1" fi fi -rm "$unc" +$RM "$unc"