patch

Use the output from diff et al. to update a file (GNU)

Syntax:

patch [option]... [origfile [patchfile]]

Runs on:

QNX Neutrino

Options:

Input options:

-p num or --strip= num
Strip num leading components from file names.
-F lines or --fuzz lines
Set the fuzz factor to lines for inexact matching.
-l or --ignore-whitespace
Ignore white space changes between the patch and the input.
-c or --context
Interpret the patch as a context difference.
-e or --ed
Interpret the patch as an ed script.
-n or --normal
Interpret the patch as a normal difference.
-u or --unified
Interpret the patch as a unified difference.
-N or --forward
Ignore patches that appear to be reversed or already applied.
-R or --reverse
Assume patches were created with old and new files swapped.
-i patchfile or --input=patchfile
Read the patch from patchfile instead of stdin.

Output options:

-o file or --output=file
Output the patched files to file.
-r file or --reject-file=file
Output rejects to file.
-D name or --ifdef=name
Make merged if-then-else output using name.
-E or --remove-empty-files
Remove output files that are empty after patching.
-Z or --set-utc
Set the times of patched files, assuming diff uses UTC (GMT).
-T or --set-time
Likewise, assuming local time.
--quoting-style=word
Output file names using quoting style word. The values for word are: literal, shell, shell-always, c, and escape. The default is taken from the QUOTING_STYLE environment variable; if this variable isn't set, patch uses shell.

Backup and version control options:

-b or --backup
Back up the original contents of each file.
--backup-if-mismatch
Back up if the patch doesn't match exactly.
--no-backup-if-mismatch
Back up mismatches only if otherwise requested.
-V style or --version-control=style
Use style version control, where style is simple, numbered, or existing.
-B prefix or --prefix=prefix
Prepend prefix to the names of backup files.
-Y prefix or --basename-prefix=prefix
Prepend prefix to the base names of backup files.
-z suffix or --suffix=suffix
Append suffix to the names of backup files.
-g num or --get=num
Get files from RCS etc., if num is positive; ask if it's negative.

Miscellaneous options:

-t or --batch
Ask no questions; skip bad-Prereq patches; assume reversed.
-f or --force
Like -t, but ignore bad-Prereq patches, and assume unreversed.
-s or --quiet or --silent
Work silently unless an error occurs.
--verbose
Output extra information about the work being done.
--dry-run
Don't actually change any files; just print what would happen.
--posix
Conform to the POSIX standard.
-d dir or --directory=dir
Change the working directory to dir first.
--binary
Read and write data in binary mode (no effect on this platform).
-v or --version
Output version info.
--help
Display some help.

Description:

The patch utility use the output from diff, diff3, and cmp to update a file.

Environment variables:

QUOTING_STYLE
The default quoting style. The possible values are: literal, shell, shell-always, c, and escape. If QUOTING_STYLE isn't set, patch uses shell. You can override this variable by using the --quoting-style option.

Contributing author:

GNU