June 22nd, 2002, 11:31 AM
" diff command in linux problem"
if we use the diff command which finds differences in the two files specified at the command prompt for example take a file named "text"
which has the contents the following:->
" this is a test file"
and other file named "exam" which has the following contents:->
"this is a exam file"
then we execute the command at the shell prompt : diff test exam
then we have the following result on the screen
< this is a test file
> this is a exam file
i want to ask is that what does 1c1 stands for?
thanks in advance
June 22nd, 2002, 11:51 AM
Clue... count the lines.
Now try it with a few more lines.
BTW, why do I get the feeling like you're trying to get us to do your homework for you?
\"Windows has detected that a gnat has farted in the general vicinity. You must reboot for changes to take affect. Reboot now?\"
June 22nd, 2002, 04:02 PM
Hehehe....good call draziw.
hackmania -- here's a good explanation of the diff command from the WONDERFUL book O'Reilly Power Tools:
But, basically, a diff report is usually in ed syntax, because if you use a diff -e, it will actually produce an ed script that when run would make file1 the same as file2. In your example, 1c1 (I think...I never use ed for anything) means line 1, change for line 1. Basically, change line 1 of the first file to be the same as line 1 of the second file.
/* You are not expected to understand this. */