- publishing free software manuals
Comparing and Merging Files with GNU diff and patch
by David MacKenzie, Paul Eggert, and Richard Stallman
Paperback (6"x9"), 120 pages
ISBN 0954161750
RRP £12.95 ($19.95)

"Well packaged... the quality of information is excellent" --- Linux User and Developer Magazine (Issue 36, Feb 2004) Get a printed copy>>>

10.8 Backup Files

Normally, patch creates a backup file if the patch does not exactly match the original input file, because in that case the original data might not be recovered if you undo the patch with ‘patch -R’ (see section 10.3.2 Applying Reversed Patches). However, when conforming to POSIX, patch does not create backup files by default. See section 10.12 patch and the POSIX Standard.

The -b or --backup option causes patch to make a backup file regardless of whether the patch matches the original input. The --backup-if-mismatch option causes patch to create backup files for mismatches files; this is the default when not conforming to POSIX. The --no-backup-if-mismatch option causes patch to not create backup files, even for mismatched patches; this is the default when conforming to POSIX.

When backing up a file that does not exist, an empty, unreadable backup file is created as a placeholder to represent the nonexistent file.

ISBN 0954161750Comparing and Merging Files with GNU diff and patchSee the print edition