Patch_(Unix) Patch_(Unix)

Patch (Unix) - Definition and Overview

Patch is a Unix computer program that applies textual difference between two programs and, more often, computer file or files containing such a difference, or diff files. The patch is typically an update meant to fix technical glitches like bugs or to improve the usability or the performance of the previous version of an application.

The original patch program was written by Larry Wall, who is also an author of a popular programming language Perl. The program is capable of applying various formats of diffs and has become quite popular among developers who frequently exchange a small change in programs with fellow programmers. Patch has become especially popular within the free software community as it allows uninitiated developers to contribute to a project. Most open source projects are hosted on a public versioning system server from which everyone can download the source code. But for obvious security reasons, only the developers of the project can be trusted with write access. Patch makes it possible for developers that do not have write access to develop the code on their own, make a patch out of it and send it to the main developers.

To apply a patch distributed as a diff-file with patch, you run the following command in a shell:

 $ patch -p1 < name_of_patch.diff

It tells patch to apply the changes to the specified files described in the diff-file and to skip the first part of the path to the files in question. Patches are often made so that the basedirectory of the source code tree is included in the diff-file, but you patch them from within the basedirectory of the source code tree and therefore has to use '-p1'.

You can also undo the application of a patch with:

 $ patch -p1 -R < name_of_patch.diff

Ports of patch

Patch has been ported to Cygwin, MinGW and native Windows.

See also

Example Usage of (Unix)

CuriousGuru: A less than 90mb download of Plan9 OS has taken me hours. I hate #virginmedia #linux #unix (ish to both)
demuxer: #cgsol Inicia @archgt conferencia y taller de OpenBSD #unix libre aprendiendo a instalar el sistema operativo
garantobazaarbo: そして顧客の話をきくことリーヌスの革新は、これをやったということじゃない(似たようなことは、もうながいこと Unix の世界の伝統になっていた)。
Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.