# 整理文档用的,把/data目录下所有.swf文件移动到子目录下,
# 子目录的名字取文件名的前2个字符;如果文件名只有
# 1个字符,则目录名为2个重叠的该字符
cd /data
ls | grep '.swf' > filelist
while read filename
do
mkdir -p ${filename:0:2}
mv ${filename} ${filename:0:2}
done < filelist
ls -1 | awk -F'.' '{
if (length($1)==1)
{
if (-d "$1$1")
{
system("mv "$0"/* "$1$1)
system("rm -rf lib/en/"$0)
}
else
{system("mv "$0" "$1$1)}
}
}'
# End of script
阅读(1904) | 评论(0) | 转发(0) |