From 476431ae68b86d0f4df57e5efdb0371b2b795be0 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 22 Oct 2011 18:33:08 +0200 Subject: [PATCH] bin/mv-p: Add. --- bin/mv-p | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/mv-p diff --git a/bin/mv-p b/bin/mv-p new file mode 100755 index 0000000..62b1b36 --- /dev/null +++ b/bin/mv-p @@ -0,0 +1,11 @@ +#!/bin/sh + +# Wrapper command for `mv` which creates the target directory before moving +# the file there. + + +# Get last argument. +for last; do :; done + +mkdir -p "`dirname "$last"`" \ + && mv "$@" -- 2.45.2