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.的更多相关文章

  1. 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 ...

  2. Using command-line Subversion to access project source files

    Help index About source code version control with Software Configuration Management (Subversion) Usi ...

  3. 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 ...

  4. Gradle Goodness: Copy Files with Filtering

    Gradle Goodness: Copy Files with Filtering Gradle's copy task is very powerful and includes filterin ...

  5. Automated Memory Analysis

    catalogue . 静态分析.动态分析.内存镜像分析对比 . Memory Analysis Approach . volatility: An advanced memory forensics ...

  6. Python之路第一课Day5--随堂笔记(模块)

    本节课程大纲: 1.模块介绍 2.time &datetime模块 3.random 4.os 5.sys 6.shutil 7.json & picle 8.shelve 9.xml ...

  7. python 常用模块之os、sys、shutil

    目录: 1.os 2.sys 3.shutil 一.os模块 说明:os模块是对操作系统进行调用的接口 os.getcwd() #获取当前工作目录,即当前python脚本工作的目录路径 os.chdi ...

  8. python模块(六)

    模块,用一砣代码实现了某个功能的代码集合. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代码的重用性和代码间的耦合.而对于一个复杂的功能来,可能需要多个函数才 ...

  9. 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 ...

随机推荐

  1. Unzip 解压报错

      $ jar xvf pcre-8.10.zip   如果出现 jar:Command not found 要用yum下载 $ yum -y install java-1.6.0-openjdk-d ...

  2. Note1

    1.关于数据库主从备份与读写分离 主服务器数据库的每次操作都会记录在二进制日志文件mysql-bin.xxx中.从服务器的I/O线程使用专用帐号登陆到主服务器中读取该二进制文件,并将文件内容写入到自己 ...

  3. python使用消息队列RabbitMq(入门)

    windows平台开发和使用 安装 安装Erlang:https://pan.baidu.com/s/1QcZDaI205uaue7mMWh5cSA 安装RabbitMQ:https://pan.ba ...

  4. SSL certificate problem: self signed certificate

    执行Git命令时出现各种 SSL certificate problem 的解决办法 2014年10月11日 10:45:40   比如我在windows下用git clone gitURL 就提示  ...

  5. flink-training-course

    目录 flink-training-course 大数据领域顶级盛会 Flink Forward Asia 2019 详情

  6. JS实现上传图片的三种方法并实现预览图片功能

    地址:http://www.jb51.net/article/118660.htm js HTML5拖拽图片预览 地址:http://www.jb51.net/article/88803.htm js ...

  7. 原生AJAX的封装

    /**调用AJAX ajaxPlug.openajax({ url: "./TestXHR.aspx", //请求地址 type: "POST", //请求方式 ...

  8. go 复合数据类型

    数组 数组是一个由固定长度的特定类型元素组成的序列,一个数组可以由零个或多个元素组成.因为数组的长度是固定的,因此在Go语言中很少直接使用数组. 数组声明方式: #第一种 ] int balance ...

  9. WPFの触发器详解

    例子1 简单触发器Triggers——满足简答的条件,触发 <Window x:Class="Styles.SimpleTriggers" xmlns="http: ...

  10. iOS 点击按钮截屏

    @interface CaptureViewController () @property (nonatomic, strong) UIImageView *backgrounView; //控制器背 ...