Languages and Scripting
Showing results for 
Search instead for 
Did you mean: 

Re: script to replicate diff is not working as expected

Trusted Contributor

script to replicate diff is not working as expected

Hi all

I'm really struggling to verify the output of two files using the diff command

I am running sles 10.2 with kernel

the two files being compared are a list of all files and directories from a source server that was migrated to a target host

I am trying to acheive a comparison between the files that have been migrated

here is my diff example

 diff --side-by-side --suppress-common-lines Linux-diff-source Linux-diff-matched-target

the output is out of line and differences common lines are being reported different and everything looks out of line!

I need some scripting help to compare the two file

the content looks something like

/usr/lib/vmware-tools/VMCF-SDK:    /usr/lib/vmware-tools/VMCF-SDK:
drwxr-xr-x root root 4096 bin32
drwxr-xr-x root root 4096 bin64
drwxr-xr-x root root 4096 lib32
/usr/lib/vmware-tools/VMCF-SDK/bin32:    /usr/lib/vmware-tools/VMCF-SDK/bin32:
-r-xr-xr-x root root 700639 c-stubber
/usr/lib/vmware-tools/VMCF-SDK/bin64:    /usr/lib/vmware-tools/VMCF-SDK/bin64:
-r-xr-xr-x root root 1545935 c-stubber
/usr/lib/vmware-tools/VMCF-SDK/doc:    /usr/lib/vmware-tools/VMCF-SDK/doc:
-rw-r--r-- root root 29682 VMCFClass_8h-source.html
-rw-r--r-- root root 6485 VMCFClass_8h.html
-rw-r--r-- root root 4469 VMCFCoreImplInt_8h-source.html
-rw-r--r-- root root 1416 VMCFCoreImplInt_8h.html
-rw-r--r-- root root 4078 VMCFCoreImpl_8c.html
-rw-r--r-- root root 11760 VMCFCoreImpl_8h-source.html
-rw-r--r-- root root 6513 VMCFCoreImpl_8h.html
-rw-r--r-- root root 4212 VMCFCore_8idl-source.html
-rw-r--r-- root root 3250 VMCFCore_8idl.html
-rw-r--r-- root root 6523 VMCFObjectImpl_8c.html
-rw-r--r-- root root 8563 VMCFObjectImpl_8h-source.html
-rw-r--r-- root root 6033 VMCFObjectImpl_8h.html
-rw-r--r-- root root 2501 annotated.html
-rw-r--r-- root root 1355 dllmain_8c.html
-rw-r--r-- root root 8077 doxygen.css
-rw-r--r-- root root 1795 exceptionVMCFCore_1_1AlreadyExists.html
-rw-r--r-- root root 1399 exceptionVMCFCore_1_1InvalidArguments-members.html
-rw-r--r-- root root 1900 exceptionVMCFCore_1_1InvalidArguments.html
-rw-r--r-- root root 1790 exceptionVMCFCore_1_1InvalidState.html
-rw-r--r-- root root 1785 exceptionVMCFCore_1_1NoResources.html
-rw-r--r-- root root 1780 exceptionVMCFCore_1_1NotAllowed.html
-rw-r--r-- root root 1770 exceptionVMCFCore_1_1NotFound.html
-rw-r--r-- root root 1790 exceptionVMCFCore_1_1NotSupported.html
-rw-r--r-- root root 2687 files.html

both files have over 200000 lines each

any help is greatly appreciated



Trusted Contributor

Re: script to replicate diff is not working as expected

can anybody help me out here?


really looking for a solid solution to prove that data I migrated has been successfull on the target node ....


I have been playing around with the grep command that may help



grep -f <taget server filelist> -vfx <source server filelist>


this should give me a list of files that are no longer on the target server or have changed that were originally on source right?

maybe I posted the thread in the wrong catagory?


thank you



Frequent Advisor

Re: script to replicate diff is not working as expected

>>maybe I posted the thread in the wrong catagory?


Yes, this category is for discussion of HP-UX. The options you are using aren't even valid with the HP-UX version of the diff command.