diff 与 patch

[root@www yul]# diff hello1.c hello2.c >hello1.patch
[root@www yul]# patch ./hello1.c < hello1.patch
patching file ./hello1.c
[root@www yul] ]# vi hello1.c
#include <stdio.h>
void main()
{
printf("Hello!This is your home!\n");
}
在该实例中,由于 patch 文件和源文件在同一目录下,因此直接给出了目标文件的目录,
在应用了 patch 之后,hello1.c 的内容变为了 hello2.c 的内容。

猜你喜欢

转载自www.cnblogs.com/lelei/p/12505146.html