![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UNIX; Compare two files | abhishek3598 | UNIX for Advanced & Expert Users | 1 | 11-06-2007 06:52 PM |
| Help! Suggestions on what I can I use my 2 unix boxes for? | JimmyChang | UNIX for Dummies Questions & Answers | 3 | 09-16-2007 01:55 PM |
| How to direct-connect two UNIX boxes | agcodba | UNIX for Advanced & Expert Users | 3 | 07-20-2007 07:23 PM |
| What can I ignore when backing up UNIX boxes? | geralex | UNIX for Dummies Questions & Answers | 4 | 09-19-2005 04:22 AM |
| text boxes, radio buttons , check boxes in c++ on unix | devy8 | High Level Programming | 3 | 07-07-2001 06:58 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Compare files across 2 UNIX boxes
Is it possible to compare two files which reside on different UNIX boxes?
(I'm using HP POSIX/Korn) Consider the scenario of a pre-production environment (box 1) and a production environment (box 2) I would like to check if some files on both boxes match or not. It's quite straightforward on one box: #---------------------------------------------------- # Function to compares files and display differences # # $1 = file1, $2 = file2 # # cmp with option -s gives the following return codes: # 0 - identical # 1 - different # 2 - inaccessable/other #---------------------------------------------------- function fn030_compare_file { cmp -s $1 $2 if [[ $? -gt 0 ]] then echo "*** Difference in files! -----> $1 <---> $2" else echo "*** OK, Files identical -----> $1 <---> $2" fi return } The only alternative I can think of is to copy the files to one box, then compare from there. NOTE: I found an excellent shell script which recursively compares the contents of two directories on one box (to find this do a google search on "cmptree"...) |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|