Code:
awk 'NR==FNR{x[$NF];next}
{print ($1 in x)?$1:"error: entry "$1" has no entry in file2"
}' FS="/" file2 file1
Use nawk or /usr/xpg4/bin/awk on Solaris.
PS. Just saw the post above,
if you wnat an output like that:
Code:
awk 'NR==FNR{x[$NF];next}
!($1 in x)&&$0="error: entry "$1" has no entry in file2"
' FS="/" file2 file1
Last edited by radoulov; 11-18-2007 at 12:43 PM..
|