使用方法

cpFileNoDir   sourceDirA    targetDirB  

只会将sourceDirA目录下的所有文件复制到targetB目录下,不会生成文件夹


cpFileNoDir(){
for file in "$1"/*
do
if [ -d "$file" ]; then
    cpFileNoDir "$file"  "$2"
fi
if [ -f "$file" ]; then
    cp "$file" "$2"
fi
done
}