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. xshell设置选中复制,右击粘贴功能

    . 设置选中复制: 工具--->选项--->键盘和鼠标--->(然后根据下图设置保存即可) 2. 设置ctrl + v 粘贴功能: 工具--->选项--->键盘和鼠标-- ...

  2. cortable 使用方法

    星期一到星期六,早上六点到晚上六点.每隔两个小时 执行语句 0 6-18/2  * * 1-6 commond

  3. 【C#学习笔记】 List.AddRange 方法

    [官方笔记] 将指定集合的元素添加到 List 的末尾 命名空间:System.Collections.Generic程序集:mscorlib(在 mscorlib.dll 中) public: vo ...

  4. HDU 3466 Proud Merchants(01背包)

    题目链接: 传送门 Proud Merchants Time Limit: 1000MS     Memory Limit: 65536K Description Recently, iSea wen ...

  5. Java导入

    导入(import)声明用于将任何类型导入编译单元.导入(import)声明出现在包声明之后,第一个类型声明之前. 有两种类型的导入声明: 单类型导入声明 按需导入声明 单类型导入声明 单类型导入声明 ...

  6. 【怒转】 idea快捷键说明大全(中英文对照)

    1 编辑[Editing] 快捷键 英文说明 中文说明 Ctrl + Space Basic code completion (the name of any class, method or var ...

  7. 使用intellij的idea集成开发工具中的git插件(转)

    转自:https://blog.csdn.net/u012225679/article/details/71123171 注意:这里并没有介绍git客户端的安装,如果要安装客户端,大家可以参考如下的链 ...

  8. SpringBoot 中定时执行注解(@Scheduled、@EnableScheduling)

    项目开发中经常需要执行一些定时任务,比如需要在每天凌晨时候,分析一次前一天的日志信息.Spring为我们提供了异步执行任务调度的方式,提供TaskExecutor .TaskScheduler 接口. ...

  9. 【leetcode】935. Knight Dialer

    题目如下: A chess knight can move as indicated in the chess diagram below:  .            This time, we p ...

  10. POJ 3159 Candies(spfa、差分约束)

    Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the he ...