GENDIFF(1) General Commands Manual GENDIFF(1)NAME
gendiff - utility to aid in error-free diff file generation
SYNOPSIS
gendiff <directory> <diff-extension>
DESCRIPTION
gendiff is a rather simple script which aids in generating a diff file from a single directory. It takes a directory name and a "diff-
extension" as its only arguments. The diff extension should be a unique sequence of characters added to the end of all original, unmodi-
fied files. The output of the program is a diff file which may be applied with the patch program to recreate the changes.
The usual sequence of events for creating a diff is to create two identical directories, make changes in one directory, and then use the
diff utility to create a list of differences between the two. Using gendiff eliminates the need for the extra, original and unmodified
directory copy. Instead, only the individual files that are modified need to be saved.
Before editing a file, copy the file, appending the extension you have chosen to the filename. I.e. if you were going to edit somefile.cpp
and have chosen the extension "fix", copy it to somefile.cpp.fix before editing it. Then edit the first copy (somefile.cpp).
After editing all the files you need to edit in this fashion, enter the directory one level above where your source code resides, and then
type
$ gendiff somedirectory .fix > mydiff-fix.patch
You should redirect the output to a file (as illustrated) unless you want to see the results on stdout.
SEE ALSO diff(1), patch(1)AUTHOR
Marc Ewing <marc@redhat.com>
4th Berkeley Distribution Mon Jan 10 2000 GENDIFF(1)
Check Out this Related Man Page
GENDIFF(1) General Commands Manual GENDIFF(1)NAME
gendiff - utility to aid in error-free diff file generation
SYNOPSIS
gendiff <directory> <diff-extension>
DESCRIPTION
gendiff is a rather simple script which aids in generating a diff file from a single directory. It takes a directory name and a "diff-
extension" as its only arguments. The diff extension should be a unique sequence of characters added to the end of all original, unmodi-
fied files. The output of the program is a diff file which may be applied with the patch program to recreate the changes.
The usual sequence of events for creating a diff is to create two identical directories, make changes in one directory, and then use the
diff utility to create a list of differences between the two. Using gendiff eliminates the need for the extra, original and unmodified
directory copy. Instead, only the individual files that are modified need to be saved.
Before editing a file, copy the file, appending the extension you have chosen to the filename. I.e. if you were going to edit somefile.cpp
and have chosen the extension "fix", copy it to somefile.cpp.fix before editing it. Then edit the first copy (somefile.cpp).
After editing all the files you need to edit in this fashion, enter the directory one level above where your source code resides, and then
type
$ gendiff somedirectory .fix > mydiff-fix.patch
You should redirect the output to a file (as illustrated) unless you want to see the results on stdout.
SEE ALSO diff(1), patch(1)AUTHOR
Marc Ewing <marc@redhat.com>
4th Berkeley Distribution Mon Jan 10 2000 GENDIFF(1)
At the office, we often have to edit one file with VI. We are 4-6 workers doing it and sometimes can be done at the same time.
We have found a problem and want to prevent it with a file lock. Is it possible and how ?
problem :
Worker-a starts edit VI session on File-A at 1PM
Worker-b... (14 Replies)
hi,
i have 2 file of the same kind
file_old and file_new
there are few extra things added in new file
i want to make diff file_old file_new > file_update
( file_update are the new things added as compare to the old file )
i can i make it clearly . bcoz in diff it show all the... (8 Replies)
Hi
I have a job that will be running nightly incremental backsup of a large directory tree.
I did the initial backup, now I want to write a script to verify that all the files were transferred correctly. I did something like this which works in principle on small trees:
diff -r -q... (6 Replies)
Hi everyone,
I want to know how to replace file extensions. For example how do i go about replacing all *.c files in a directory to *.cpp
I think we can do it either with "find" commad or with special registers. I tried to use the following command
mv \(.*\).c \1.cpp
but it is giving... (7 Replies)
I have a file say test.txt, data in that file is in format such that
1st column represents number of executions of particular function
2nd column represents total amount of time
3rd column represents function name
I want to get the poor/slow performing function from this file.
So, ideally... (13 Replies)
Hi..
Am using diff to compare 2 directories(A & B) and as ouput i get a list of files which are found only in directory B ( I used grep & sed to create the list).
Now I want to delete the files which are found only in dir B after 3 days.
Please help me with this.
Thanks
CoolAtt (7 Replies)
I have 2 directories a/ and b/,
they have different subdirectories, how to diff with missing file, or missing subdirectory
and if i have in a/ directory "a/ACD/DEF" DEF is a file, but in b/ directory "b/ACD/DEF is a SUBDIRECTORY, how to diff it, thanks
my solution for directories,
... (7 Replies)
Hi!
I have this shell script that I need to finish. Currently I need to fix one line to make it work. I need to change a file extension. See this code, is pretty simple.
#!/bin/sh
# Extensions
OLD_EXT=.flv
NEW_EXT=.mp4
COUNT_FILES=$(ls -l *$OLD_EXT | grep ^- | wc -l)
if ; then
... (8 Replies)
Can somebody explain to me why the diff output is not going to stderr?
Yet when I issue a diff from the command line the return code is -ne 1.
I am guessing diff always writes to stdout???
Is there away I can force the difff to write to stderr USING THE CURRENT
template. If possible, I... (5 Replies)
Hi,
I am using scp to copy a certain directory over the network. This folder contain some files that I am not interested in. My question is; is it possible to copy files of certain extension only, keeping the same directory hierarchy as it is (that is sub-folders)?
Thanks (8 Replies)
Hi everyone
When I'm starting my script I'm giving to it two parameters:
script.sh ext1 ext2
I need to copy all files in a directory fitting ext1, to the same folder, with the same names, but with the changed extension to ext2.
Till now I've just managed to do it for only 1 file, but I... (16 Replies)
Ok here is what I have going on.
I am listing the contest of a directory so I can edit and delete files.
The code I am using to do that is below (Other then editing as it does not work).
<?php
$directory = ("enctlfiles/");
$dir = opendir($directory);
$files = array();
while (($file =... (10 Replies)
Can you help me to fix my error please?! I checked the code and I think there is no mistake, but when I run it gives me error such
line 1: /Users/Manu/trials/hosts: is a directory
sort: open failed: /Users/Manu/trials/hosts/*: No such file or directory
Help me please...
mycode NAME value.... (9 Replies)
Hi all,
I have 2 directories on two different servers. I am trying to find out what is missing from directory X and what is missing from directory Y. they should both have the same exact files in them.
I understand some files may be missing from both directories on each server. I am not sure... (8 Replies)