perl -F: -lane 'exists $h{$F[2]} ? print "$F[2] in $h{$F[2]} and $ARGV" : ($h{$F[2]} = $ARGV)' passwd1 passwd2