extract specified contents from two files.
src_dir=$(pwd)/All_h
dst_dir=$(pwd)/All
diff_dir=$(pwd)/diff if [ ! -d $diff_dir ]
then
mkdir $diff_dir
fi for src_full_entry in $src_dir/*
do
src_cat_entry=$(echo $src_full_entry | sed -e "s/\.[0-9a-rA-F]\{8\}$//")
src_cat_entry=$(basename "$src_cat_entry")
src_ivr_log="$src_full_entry/de_ivr.log"
if [ -f "$src_ivr_log" ]
then
#echo "$src_cat_entry"
dst_ivr_log=$(find $dst_dir -regextype posix-egrep -regex ".*/$src_cat_entry\.[0-9A-Fa-f]{8}/ivr.log$")
#echo $dst_ivr_log
if [ -f "$dst_ivr_log" ]
then
diff_ivr_log="$diff_dir/$src_cat_entry.diff"
summary="$diff_dir/$src_cat_entry""_summary.txt"
#echo $diff_ivr_log
#diff -u "$src_ivr_log" "$dst_ivr_log" > "$diff_ivr_log" echo "" > "$summary" echo "##########################################################" >> "$summary"
echo "$src_ivr_log:" >> "$summary"
echo "##########################################################" >> "$summary"
grep -i -n -A 20 "$src_cat_entry" "$src_ivr_log" >> "$summary" echo "" >> "$summary"
echo "##########################################################" >> "$summary"
echo "" >> "$summary" echo "##########################################################" >> "$summary"
echo "$dst_ivr_log:" >> "$summary"
echo "##########################################################" >> "$summary"
grep -i -n -A 20 "$src_cat_entry" "$dst_ivr_log" >> "$summary"
#diff -u "$src_ivr_log" "$dst_ivr_log"
fi
fi
done
if we want to use regular expressions for find command, we can do it like this.
find $dst_dir -regextype posix-egrep -regex ".*/$src_cat_entry\.[0-9A-Fa-f]{8}/ivr.log$"
extract specified contents from two files.的更多相关文章
- How to extract msu/msp/msi/exe files from the command line
http://www.windowswiki.info/2009/02/19/how-to-extract-msumspmsiexe-files-from-the-command-line/ Micr ...
- Using command-line Subversion to access project source files
Help index About source code version control with Software Configuration Management (Subversion) Usi ...
- Reading Text-based Files In ASP.NET
Friday, July 17, 2015 1:43 PM Every time I need to work with the contents of text-based files in an ...
- Gradle Goodness: Copy Files with Filtering
Gradle Goodness: Copy Files with Filtering Gradle's copy task is very powerful and includes filterin ...
- Automated Memory Analysis
catalogue . 静态分析.动态分析.内存镜像分析对比 . Memory Analysis Approach . volatility: An advanced memory forensics ...
- Python之路第一课Day5--随堂笔记(模块)
本节课程大纲: 1.模块介绍 2.time &datetime模块 3.random 4.os 5.sys 6.shutil 7.json & picle 8.shelve 9.xml ...
- python 常用模块之os、sys、shutil
目录: 1.os 2.sys 3.shutil 一.os模块 说明:os模块是对操作系统进行调用的接口 os.getcwd() #获取当前工作目录,即当前python脚本工作的目录路径 os.chdi ...
- python模块(六)
模块,用一砣代码实现了某个功能的代码集合. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代码的重用性和代码间的耦合.而对于一个复杂的功能来,可能需要多个函数才 ...
- Basic linux command-with detailed sample
Here I will list some parameters which people use very ofen, I will attach the output of the command ...
随机推荐
- django-redis-cache缓存使用
1. redis安装配置 (1)到redis目录 [root@localhost redis-2.8.17]# ls 00-RELEASENOTES CONTRIBUTING deps Makefil ...
- 详解Linux运维工具:运维流程管理、运维发布变更、运维监控告警
概述 应用上线后,运维工作才刚开始,具体工作可能包括:升级版本上线工作.服务监控.应用状态统计.日常服务状态巡检.突发故障处理.服务日常变更调整.集群管理.服务性能评估优化.数据库管理优化.随着应用 ...
- H5rem
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1, ...
- Html5 学习笔记 --》html基础 css 基础
HTML5 功能 HTML5特点 <!DOCTYPE html> <html lang="zh-cn"> <head> <meta cha ...
- B. pSort
题目链接: http://codeforces.com/problemset/problem/28/B 题意: 给一个n,原本有个1到n按顺序排列的序列,给一个序列问,在给一个数组,表示这个位置的数可 ...
- python 装饰器 第二步:扩展函数的功能(不修改原函数)
# 第二步:扩展函数的功能(不能修改原函数) # 用于扩展基本函数的函数 # 把一个函数(eat函数)作为一个整体传给另外一个函数(kuozhan函数) # 这个函数(kuozhan函数)用形参fun ...
- Windows及MAC 安装Python3.7.4
Windows没有Python环境,Mac自带Python 2,所以开发者需要下载Python 3进行开发相关工作,此文章介绍如何安装Python,Mac安装前可以在终端数输入python查看自带版本 ...
- 深度学习之Tensorflow 工程化项目实战 配套资源
https://www.aianaconda.com/index/CodeProject
- mysql 根据字母排序
select CONVERT(u.user_name USING gbk) AS user_name from table where 1=1 order by user_name
- 安装cuDNN
cuDNN cuDNN是GPU加速计算深层神经网络的库(下载链接,前文已提供). 本人的下载文件是:cudnn-7.0-linux-x64-v4.0-prod.tgz 在终端中切换到文件所在文件夹,输 ...