《Linux diff与patch的深入分析》
diff的输出格式分为传统格式和统一格式
1)diff的传统格式输出.
############################################
cat before.txt
输出:
This is a line to be deleted
This is a line that will be changed
This is a line that will be unchanged
cat after.txt
输出:
This is a line that has been changed
This is a line that will be unchanged
This is a line that has been added
############################################
diff before.txt after.txt
输 出:
1,2c1
< This is a line to be deleted
< This is a line that will be changed
---
> This is a line that has been changed
3a3
> This is a line that has been added
############################################
注释:
传统格式的输出
1,2c1是指替换第1个文件的第1,2行到第2个文件的第2行,这里的1,2是指第1个文件的第1,2行,c是替换的意思,最后的1是第2个文件的第1行
<号是指第1个文件更改或删除的行
---号是分割两个文件
>号是第2个文件中增加或删除的行
3a3是指将第2个文件的第3行插入到第一个文件的第3行
也就是说第1个文件的:
< This is a line to be deleted
< This is a line that will be changed
被替换成第2个文件的:
> This is a line that has been changed
由于第1个文件的第3行和第2个文件的第2行一致,所以不做修改.
由于第2个文件的第3行是第1个文件所不具有的,所以在第1个文件的最后一行增加:
> This is a line that has been added
2)patch命令的应用
用diff的传统格式输出:
#################################
diff before.txt after.txt >mypatch.txt
#################################
用patch修补before.txt文件,使before.txt和after.txt一致.
#################################
cat mypatch.txt |patch before.txt
输出:
patching file before.txt
#################################
比较两个文件,现在是一致的了.
#################################
cmp before.txt after.txt
#################################
用patch命令恢复before.txt.
#################################
patch -R before.txt <mypatch.txt
输出:
patching file before.txt
#################################
注:-R标记告诉patch在反向上应用区别或者撤销patch.
再
相关文档:
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
1、class的定义一定要在后面加“;”
2、用cout时要在main函数前加 using namespace std;
3、出现 undefined reference to `std::ios_base::Init::Init() 提示的话,问题是gcc编译器出现的,解决的办法是:在linux下编译c++ 程序要使用g++ 编译器,如果你要是使用gcc编译器就会有上面的报错信息,只要在在gcc后加 ......
参考网址:
http://trac.edgewall.org/wiki/TracInstall
http://trac.edgewall.org/wiki/TracInstallPlatforms
http://trac.edgewall.org/wiki/TracOnRhel5
http://dag.wieers.com/rpm/FAQ.php#B
http://tech.idv2.com/2008/12/26/install-trac-on-linux/
软件下载地址:
trac:http://trac.edgewall.org/wiki/TracDo ......
Emebedded System and Application(Linux)
Goal
--
掌握嵌入式系统开发的流程,系统移植的方法,编写Bootloader
(Be familiar with the process of ES Developing
, System Migration
amd Bootloader Programming
)
Requriem ......