使用shell批处理文件夹下的所有文章

来源:互联网 发布:复旦大数据学院 课程 编辑:程序博客网 时间:2024/06/17 06:57
#!/bin/bash
outputpath="./jitter"
if [ ! -d "$outputpath" ]; then
mkdir "$outputpath"
fi


filelist=`ls`

#注意是`
for filename in $filelist
do
echo "$filename"
if [ -f "$filename" ]; then
echo "come in"
newname=$filename.tm

dcat "$filename" | perl ../gettime.pl > $outputpath/$newname

#使用管道技术,调用了PERL
echo "$newname creat"
fi
done #不要忘了
原创粉丝点击