LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Question on diff's output (https://www.linuxquestions.org/questions/programming-9/question-on-diffs-output-632827/)

just.srad 04-03-2008 07:15 PM

Question on diff's output
 
Hi,

Anyone here could help to explain what do the code
"0a1" and "2d2" mean? I tried to search in the web for the explanation but
couldn't find any. Thanks.

Code:

diff --normal file1 file2
0a1
> hoho
2d2
< hee
4,7c4




---
> yo

Justin

chrism01 04-03-2008 07:38 PM

Start here: http://lowfatlinux.com/linux-compare-files-diff.html

JWPurple 04-03-2008 09:09 PM

To make file2 from file1,

at line 0 of file1, insert a line, which becomes line 1 in file2

at line 2 of file1, delete the line, but a line 2 still exists in file2 (not entirely sure of this one)

from lines 4 through 7 of file1, change by removing 4 lines from file1, and replacing them with 1 line, which becomes line 4 of file2

just.srad 04-03-2008 10:31 PM

Quote:

Originally Posted by chrism01 (Post 3109985)

Thanks man, that's a great one. It's more of a information , i think i can ignore it , just take note of the ">" and "<" signs will do.

just.srad 04-03-2008 10:33 PM

Quote:

Originally Posted by JWPurple (Post 3110039)
To make file2 from file1,

at line 0 of file1, insert a line, which becomes line 1 in file2

at line 2 of file1, delete the line, but a line 2 still exists in file2 (not entirely sure of this one)

from lines 4 through 7 of file1, change by removing 4 lines from file1, and replacing them with 1 line, which becomes line 4 of file2

Thanks for your feedback too. I'll check my two files when i get back home.. because they are resided in my home pc.. ;)


All times are GMT -5. The time now is 07:59 AM.