/etc/zsh/zshrc: added bk() to backup a file with iso time tagged
[grml-etc-core.git] / etc / zsh / zshrc
index 0f43289..a13720a 100644 (file)
@@ -1502,6 +1502,11 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"."
     exec env -i ENV="/etc/minimal-shellrc" HOME="$HOME" TERM="$TERM" ksh
   }
 
+  # make a backup of a file
+  bk() {
+    cp -a "$1" "${1}_$(date --iso-8601=seconds)"
+  }
+
   # Switching shell safely and efficiently? http://www.zsh.org/mla/workers/2001/msg02410.html
   # bash() {
   #  NO_SWITCH="yes" command bash "$@"