修改文件名的脚本
#!/bin/bash
path=`pwd`
da=`ls -l $path | grep -v total | awk '{print $9}'`
for i in $da
do
mv $path/$i/*.xml $path/$i/"$i"_46c221be-6ab2-ef53-1589-fe16877914f4_chk.xml
done
修改文件内容
#!/bin/bash
path=`pwd`
da=`ls -l $path | grep -v total | awk '{print $9}'`
for k in $da
do
sed -i "s/awk/$k/g" $path/$k/"$k"_46c221be-6ab2-ef53-1589-fe16877914f4_chk.xml
done
归档文件到一个 目录
#!/bin/bash
path=`pwd`
da=`ls -l $path | grep -v total | awk '{print $9}'`
for k in $da
do
mv $path/$k/"$k"_46c221be-6ab2-ef53-1589-fe16877914f4_chk.xml /apps/txt/file
done
网友评论