diff --git a/shell/bashrc b/shell/bashrc index e2e0b0b..8eccb6d 100644 --- a/shell/bashrc +++ b/shell/bashrc @@ -204,10 +204,10 @@ 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() +bf () { -DATE=$(/bin/date +%Y-%m-%d_%H:%M:%S.%N) -local TMPFILE=tmp.${DATE}.bak +DATE=$(/bin/date +%Y-%m-%d_%H:%M:%S.%N); +local TMPFILE=${1}.${DATE}.bak; /bin/cp "$1" $TMPFILE } fi