hi,
I am trying to make a short script to copy files, whole tree structures ... This is how I started
###3 copyTree - cp tree structure: copyTree "*.dat" "*.txt" "C:/...."
Code:
function copyTree() {
if [ $# = 2 ]
then
find -depth -name "$1" -print0 | cpio --null -pvd $2
elif [ $# = 3 ]
then
find -depth -name "$1" -name "$2" -print0 | cpio --null -pvd $2
elif [ $# = 4 ]
then
find -depth -name "$1" -name "$2" -name "$3" -print0 | cpio --null -pvd $2
fi
}
It works when I use it like
copyTree "*.dat" "C:/...."
but not works when trying
copyTree "*.dat" "*.txt" "C:/...."
Why?
thanks