Link to home
Start Free TrialLog in
Avatar of raaj4354
raaj4354

asked on

Script to compare tar files

using cygwin on windows and trying to compare two tar files and to print out the difference between them.
SOLUTION
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you just want to compare the filenames that are in the .tar files? That is what the diff above is doing. If you want to compare the files then you'd have to find files with the same name in tar1 and tar2 first and then compare each file. To do this you need to untar both archives as well.
Actually the above diff has a good chance of finding file changes because of using tar -tvf. The v means you get file size and modification date - quite a good indication of any change although not rigorous.
To only compare file names, use tar -tf
Avatar of raaj4354
raaj4354

ASKER

I need to compare the file contents of two tar files and list the names of the different files(diff in content) and any new files in either tar files.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial