#!/bin/bash
cat tomcat_history | while read line;do #################每行读
zhifu_1=`echo ${line:0:1}`
if [ $zhifu_1 = "#" ];then
zhifu_2=`echo ${line:1}`
date_1=`echo $zhifu_2 | awk '{print strftime("%Y-%m-%d %T",$1)}'` ############时间格式
echo -n "$date_1" ############# 取消换行
else
echo " $line"
fi
done
阅读(318) | 评论(0) | 转发(0) |