rmv, mv with rsync
This commit is contained in:
13
qcd_function
13
qcd_function
@@ -179,3 +179,16 @@ function gcd() {
|
|||||||
}
|
}
|
||||||
echo No match.
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user