diff --git a/qcd_function b/qcd_function index 3e9dc05..1ef7689 100644 --- a/qcd_function +++ b/qcd_function @@ -192,9 +192,11 @@ function rmv () { #mv with rsync local sources sources=() + # remove / from ends, if target is an existing folder for (( i=1; i<=$(($#-1)); i++ )) - do if [ -d "${!i}" ] + do if [ -d "${@: -1}" ] then sources+=("${!i%/}") + else sources+=("${!i}") fi done rsync -vaP --remove-source-files "${sources[@]}" "${@: -1}"