I have files containing lots of lines of data, some of which are duplicated. I want to delete duplicate lines if they follow each other.
For example if the input file contained this:
string1
string2
string2
string3
string1
string4
string4
string4
I would want the output file to read:
string1
string2
string3
string1
string4
I am fairly new to bash scripts. I am presuming awk is the way to go but I am a bit stumped. Any help appreciated.