X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fmv-p;h=f9620871fc92b1e06b0355c41ff20fe7b08fa069;hb=8f24a1138ad378038239e8d0cb9619864f7ca026;hp=2faade8bc3e70754903c32c9f35686dd74f8286a;hpb=614f9080ac810a2f4c0a5244bca856f3358e625e;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 "$@"