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) :confused:

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"...)

You do realize there's already a perfectly good program to compare files without you building your own, right? It's called 'diff'.

As for comparing files on different systems, you could mount a directory from one machine onto another with nfs.

Basicly you need to get the remote file back to your local system to be able "diff" the two. Mount via nfs, or try a "rcp" to get a copy...

Can't think of a way you can use "diff" on two files where one is local and the other is remote?