Web servers - Comparing and Merging Source Files CHAPTER 6 91
Tuesday, May 8th, 2007Comparing and Merging Source Files CHAPTER 6 91 *************** *** file1_line_range **** file1 line file1 line… — file2_line_range file2 line file2 line… COMPARING AND MERGING SOURCE FILES The first three lines identify the files compared and separate this information from the rest of the output, which is one or more hunks of differences. Each hunk shows one area where the files differ, surrounded (by default) by two line of context (where the files are the same). Context lines begin with two spaces and differing lines begin with a !, +, or -, followed by one space, illustrating the difference between the files. A + indicates a line in the file2 that does not exist in file1, so in a sense, a + line was added to file1 to create file2. A -marks a line in file1 that does not appear in file2, suggesting a subtraction operation. A ! indicates a line that was changed between file1 and file2; for each line or group of lines from file1 marked with !, a corresponding line or group of lines from file2 is also marked with a !. To generate a context diff, execute a command similar to the following: $ diff -C 1 sigrot.1 sigrot.2 The hunks look like the following: *** sigrot.1 Sun Mar 14 22:41:34 1999 —sigrot.2 Mon Mar 15 00:17:40 1999 **** 2,4 **** # sigrot.sh ! # Version 1.0 # Rotate signatures —2,4 — # sigrot.sh ! # Version 2.0 # Rotate signatures *************** *** 8,19 **** sigfile=signature ! old=$(cat num) let new=$(expr $old+1) ! if [ -f $sigfile.$new ]; then ! cp $sigfile.$new .$sigfile ! echo $new > num else ! cp $sigfile.1 .$sigfile ! echo 1 > num
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services