patch

Name

patch -- apply a diff file to an original

Description

The specification for "patch" is as specified in the SUS but with the following differences as listed below.

Differences

--backup-if-mismatch

Back up a file if the patch does not match the file exactly and if backups are not otherwise requested.

--no-backup-if-mismatch

Do not back up a file if the patch does not match the file exactly and if backups are not otherwise requested.

-B pref, --prefix=pref

prefix pref to a file name when generating its simple backup file name.

--binary

Read and write all files in binary mode, except for standard output and /dev/tty. This option has no effect on POSIX-compliant systems.

--dry-run

Print the results of applying the patches without actually changing any files.

-E, --remove-empty-files

Remove output files that are empty after the patches have been applied. When patch removes a file, it also attempts to remove any empty ancestor directories.

-f, --force

Skip patches whose headers do not say which file is to be patched; patch files even though they have the wrong version for the Prereq: line in the patch; and assume that patches are not reversed even if they look like they are.

-F num, --fuzz=num

Set the maximum fuzz factor. This option only applies to diffs that have context, and causes patch to ignore up to that many lines in looking for places to install a hunk.

-g num, --get=num

This option controls patch's actions when a file is under RCS or SCCS control, and does not exist or is read-only and matches the default version. If num is positive, patch gets (or checks out) the file from the revision control system; if zero, patch ignores RCS and SCCS and does not get the file; and if negative, patch asks the user where to get the file.

-s, --silent, --quiet

Work silently, unless an error occurs.

-t, --batch

Suppress questions like -f, but make some different assumptions: skip patches whose headers do not contain file names; skip patches for which the file has thewrong version for the Prereq: line in the patch; and assume that patches are reversed if they look like they are.

-T, --set-time

Set the modification and access times of patched files from time stamps given in context diff headers, assuming that the context diff headers use local time.

-u, --unified

Interpret the patch file as a unified context diff.

-v, --version

Print out patch's revision header and patch level, and exit.

-V method, --version-control=method

Use method to determine backup file names. The method can also be given by the PATCH_VERSION_CONTROL environment variable, which is overridden by this option.

--verbose

Output extra information about the work being done.

-x num, --debug=num

Set internal debugging flags of interest only to patch patchers.

-Y pref, --basename-prefix=pref

Prefix pref to the basename of a file name when generating its simple backup file name.

-z suffix, --suffix=suffix

Use suffix as the simple backup suffix.

-Z, --set-utc

Set the modification and access times of patched files from time stamps given in context diff headers.

--help

display this help and exit