diff .bash_overrides @ 544:ed193fcaa0dc

wip
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 17 Oct 2013 04:37:17 -0700
parents 32b202653753
children 501169756134
line wrap: on
line diff
--- a/.bash_overrides	Sun Sep 29 08:51:51 2013 -0700
+++ b/.bash_overrides	Thu Oct 17 04:37:17 2013 -0700
@@ -126,6 +126,24 @@
 
 }
 
+function mv {
+    num=$#
+    if (( num == 0 ))
+    then
+        command mv "$@"
+        return
+    fi
+    last=${!#}
+    directory=$(dirname ${last})
+    if [[ ! -e "${directory}" ]]
+    then
+        mkdir -p "${directory}"
+    fi
+    command mv "$@"
+    return
+
+}
+
 function unlink {
     command unlink `echo $@ | sed 's/\/$//g'`
 }