码迷,mamicode.com
首页 > 其他好文 > 详细

日志文件批量重命名

时间:2015-08-12 19:05:09      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:

#!/bin/bash
#2015-08-12 ip_pool
=(`echo 10.20.34.{11..14}` `echo 10.142.194.{25..32}`) for ip in ${ip_pool[@]};do node=`ls /disk3/YH_DATA/DATA/mobile2.0/${ip}/pv` for n in ${node};do cd /disk3/YH_DATA/DATA/mobile2.0/${ip}/pv/${n} ls pv+2015*.log|sed "s/pv+\([^.]\+\)\(\.log\)/mv & clientpv+${n}+${ip}+\1\2/e" done done for ip in ${ip_pool[@]};do node=`ls /disk3/YH_DATA/DATA/mobile2.0/${ip}/info` for n in ${node};do cd /disk3/YH_DATA/DATA/mobile2.0/${ip}/info/${n} ls client+weblogicLogsName*+2015*.log|sed "s/client+\([^.]\+\)\(2015.*\.log\)/mv & client+${n}+${ip}+\2/e" done done for ip in ${ip_pool[@]};do node=`ls /disk3/YH_DATA/DATA/mobile2.0/${ip}/interface` for n in ${node};do cd /disk3/YH_DATA/DATA/mobile2.0/${ip}/interface/${n} ls client+2015*.log|sed "s/client+\([^.]\+\)\(\.log\)/mv & client+${n}+${ip}+\1\2/e" ls client-open+2015*.log|sed "s/client-open+\([^.]\+\)\(\.log\)/mv & client-open+${n}+${ip}+\1\2/e" done done

 

日志文件批量重命名

标签:

原文地址:http://www.cnblogs.com/Eivll0m/p/4725074.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!