rmv closer to mv behavior
This commit is contained in:
@@ -190,7 +190,14 @@ function gcd() {
|
|||||||
|
|
||||||
function rmv () {
|
function rmv () {
|
||||||
#mv with rsync
|
#mv with rsync
|
||||||
rsync -vaP --remove-source-files "$@"
|
local sources
|
||||||
|
sources=()
|
||||||
|
for (( i=1; i<=$(($#-1)); i++ ))
|
||||||
|
do if [ -d "${!i}" ]
|
||||||
|
then sources+=("${!i%/}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
rsync -vaP --remove-source-files "${sources[@]}" "${@: -1}"
|
||||||
# remove empty folders from sources (not last argument)
|
# remove empty folders from sources (not last argument)
|
||||||
for (( i=1; i<=$(($#-1)); i++ ))
|
for (( i=1; i<=$(($#-1)); i++ ))
|
||||||
do if [ -d "${!i}" ]
|
do if [ -d "${!i}" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user