Testing two adjacent lines
I have a file with my lines and I want to compare lines that are one after the other to test if they are the same except for the last column. For example:

    example/example 321
    example/example 456
    otherexample/otherexample 321

In this case, I want the program to simply return:

    example/example

As the first column matches, but the second column is different. What is the best way to do this using Unix tools? So far I have tried *awk* but have had little success. Thanks very much.
Testing two adjacent lines
===

I have a file with my lines and I want to compare lines that are one after the other to test if they are the same except for the last column. For example:

    example/example 321
    example/example 456
    otherexample/otherexample 321

In this case, I want the program to simply return:

    example/example

As the first column matches, but the second column is different. What is the best way to do this using Unix tools? So far I have tried *awk* but have had little success. Thanks very much.