From c714789432329345c0dd01f4afcba11e807a428a Mon Sep 17 00:00:00 2001 From: motius Date: Wed, 9 Aug 2017 15:28:35 +0200 Subject: [PATCH] fast backup file w/ bf() shell function. --- shell/bashrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/bashrc b/shell/bashrc index 46a02d8..e2e0b0b 100644 --- a/shell/bashrc +++ b/shell/bashrc @@ -204,6 +204,12 @@ DATE=$(/bin/date +%Y-%m-%d_%H:%M:%S.%N) local TMPFILE=tmp.${DATE}.sw mv "$1" $TMPFILE && mv "$2" "$1" && mv $TMPFILE $2 } +bf() +{ +DATE=$(/bin/date +%Y-%m-%d_%H:%M:%S.%N) +local TMPFILE=tmp.${DATE}.bak +/bin/cp "$1" $TMPFILE +} fi #date() {