Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

User Commands (p - r) patch(1)
NAME
patch - Applies changes to les
SYNOPSIS
patch
[-bflNRsSv ]
[-c | -n ]
[-B prex ]
[-d directory ]
[-D dene ]
[-i patchle ]
[-o outle ]
[-p [number ]]
[-r rejectle ]
[original_le ]
[[+ ags ][original_le ]...]
FLAGS
-b Saves a copy of the original contents of each modied le, before the differences
are applied, in a le of the same name with the sufx .orig appended. If the le
already exists, it is overwritten; if multiple patches are applied to the same le,
the .orig le is written only for the rst patch. If -o outle is also specied,
patchle.orig is not created, but if outle already exists, outle.orig is created.
-B prefix Species a prex to the backup lename.
-c Interprets the patch le as a context diff script (the output of diff when the -c or
-C ag is specied).
-d directory Changes the current directory to directory before processing.
-D define Uses the C preprocessor #ifdef dene #endif construct to mark changes. The
dene argument is used as the differentiating symbol.
-f Suppresses queries to the user. To suppress commentary, use the -s ag.
-i patchfile Reads the patch information from the le named by patchle, rather than from
the standard input le.
-l Causes any sequence of spaces and tabs (white space) in the diff script to match
any sequence of spaces in the input le. Other characters are matched exactly.
-n Interprets the script as a normal diff script.
-N Ignores patches where the differences have already been applied to the le; by
default, already applied patches are rejected. (See the -R ag.)
-o outfile Instead of modifying the les (specied by the patchle argument or the diff list-
ings) directly, writes a copy of the le referenced by each patch, with the
appropriate differences applied, to outle. Multiple patches for a single le are
applied to the intermediate versions of the le created by any previous patches,
and result in multiple, concatenated versions of the le written to outle.
-p [number ] Sets the pathname strip count, which controls how pathnames found in the patch
le are treated. This ag is useful if you keep your les in a different directory
than that specied by the patch. The strip count number species how many
slashes to strip from the front of a pathname. Any intervening directory names
are also stripped.
527188-004 Hewlett-Packard Company 77