Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using diff

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

Not sure if this is quite the right place to post this - but I'm hoping someone will know the answer :)

I'm trying to use "diff" via SSH to show the differences in 2 files. I'm using:

diff file1.html file2.html

...I need to show the line numbers too - and suggestions as to how that can be done?

TIA

Andy
 
BTW, heres the example output:

Code:
linkssql@undevmac linkssql $ diff test.sh test3.sh
1c1
< mysql -ufoo -pfoo foo;
---
> -ufoo -pfoo foo;
2a3,6
> gdfgdfgdfgdg
>
>
> line 6 added
\ No newline at end of file


I'm guessing the bits like 2a3,6 mean something in terms of the line numbers? I can't seem to find anything to advise exactly what they mean though :/

The files contents are BTW:

test.sh
Code:
mysql -ufoo -pfoo foo;
SELECT * FROM test;

test3.sh
Code:
-ufoo -pfoo foo;
SELECT * FROM test;
gdfgdfgdfgdg


line 6 added

TIA!

Andy
 
Hi,

Yeah, sorry about that (wasn't sure where to post my question =))

Thanks for the reply - thats pointed me in the right direction.

Cheers

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top