lemon批量蒯
RT,很久以前写的拿出来骗一骗访问量
把sh文件扔进source里面运行sh *.sh
从子目录蒯出来:
#!/bin/bash
for file in ./*/*/*.cpp
do
name=${file##*/}
fa=${file#*/}
fa=${fa#*/}
fa=${fa%/*}
filename=${name%.*}
coder=${file#*/}
coder=${coder%%/*}
if test $filename = $fa
then
cp $file ./$coder/$name
fi
done
蒯进子目录:
#!/bin/bash
for file in ./*/*.cpp
do
mulu=${file%/*}
name=${file##*/}
sourcename=${name%.*}
if [ -a $mulu/$sourcename ]; then
if [ ! -d $mulu/$sourcename ];then
rm $mulu/$sourcename
mkdir $mulu/$sourcename
fi
else mkdir $mulu/$sourcename
fi
if [ ! -a $mulu/$sourcename/$name ];then
cp $file $mulu/$sourcename/$name
fi
done
博主是蒟蒻,有问题请指出,谢谢!
本博客中博文均为原创,未经博主允许请勿随意转载,谢谢。
本博客中博文均为原创,未经博主允许请勿随意转载,谢谢。