diff --git a/qcd_function b/qcd_function index 7c9ee3a..a3d3b2a 100644 --- a/qcd_function +++ b/qcd_function @@ -179,3 +179,16 @@ function gcd() { } echo No match. } + +function rmv () { +#mv with rsync + local length + local sources + rsync -vaP --remove-source-files "$@" + # remove empty folders from sources (not last argument) + for (( i=1; i<=$(($#-1)); i++ )) + do if [ -d "${!i}" ] + then find "${!i}" -depth -type d -exec rmdir \{\} \; + fi + done +}