X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fmv-p;h=f9620871fc92b1e06b0355c41ff20fe7b08fa069;hb=92c767c45adb0801913b72675d4afa7bfa0b2e57;hp=2faade8bc3e70754903c32c9f35686dd74f8286a;hpb=a0e89499b7a01724b8a2806805d8432e30e4aace;p=config%2Fdotfiles.git diff --git a/bin/mv-p b/bin/mv-p index 2faade8..f962087 100755 --- a/bin/mv-p +++ b/bin/mv-p @@ -3,7 +3,7 @@ # Wrapper command for `mv` which creates the target directory before moving # the file there. -# Copyright (C) 2011-2012 Simon Ruderich +# Copyright (C) 2011-2013 Simon Ruderich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,9 @@ # Get last argument. -for last; do :; done +for last; do + : +done mkdir -p "`dirname "$last"`" \ && mv "$@"