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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix scirpting problem

Status
Not open for further replies.

dambrose

MIS
Aug 29, 2002
3
US
I have two that I would like to compare the difference and output that to a file.
(start file 1)
Class Name: An_agentas2_D_Applic_1
Class Type: MS-Windows-NT (13)
Active: yes
Class Name: An_agentas2_D_Applic_2
Class Type: MS-Windows-NT (13)
Active: yes
Class Name: An_agentas2_D_Applic_3
Class Type: MS-Windows-NT (13)
Active: yes
(end file 1)

(start file 2)
Class Name: An_agentas2_D_Applic_1
Class Type: MS-Windows-NT (13)
Active: no
Class Name: An_agentas2_D_Applic_2
Class Type: Standard
Active: yes
Class Name: An_agentas2_D_Applic_3
Class Type: MS-Windows-NT (13)
Active: yes
(end file 2)

As you can see in the second file the active and the standard lines are different. What I would like to do is if there is any difference between these files. Export the difference and get the Class Name line right above the line that was changed.
 
You really need to look up the man pages for diff and then redirect the output from that to a file:

diff file1 file2 > differences

If you're learning, you need to learn, not copy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top