![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
map comparsion
Hi all
I have to compare maps/files on two seperate boxes and the output must be as following: 1)list the maps/file on box1 2)list the maps/file on box2 3)List maps in both the environments a) which are same b)which are different pls any ideas are appreciated thnks |
| Forum Sponsor | ||
|
|
|
|||
|
Use find to create a file that has checksums. Do it on box1 and then box2.
Code:
find /path/to/maps -type f -exec cksum {} \; | awk '{print $3, $2, "box1" }' > box1.lis
find /path/to/maps -type f -exec cksum {} \; | awk '{print $3, $2, "box2" }' > box2.lis
Now you can awk to find the duplicates, and the checksums tell you if the files are the same or not. box1.lis and box2.lis tell you the names of all of the files on each box. If this did not so homework-ish, I'd show the awk code. |
|
|||
|
map comparsion
Quote:
thanks for the reply,but there is a constraint which i forgot to tell you and that is , i must be on the source server only and need to remotely log onto the target server using the ssh command. Thank You once again |
|||
| Google The UNIX and Linux Forums |