Is there any way to compare (part of) the hold space against the pattern space for sed? for instance, I have the following lines
name1 id1 12-04-2016 name1 id2 12-03-2016 name2 id3 12-04-2016 name2 id4 12-03-2016
My end goal is to remove the first line where name is duplicated. So my thought process was
1) compare name field to hold space.
2) If it matches, delete line in pattern space
3) If it doesn't, copy line to hold space.
However I cannot find anything that details how to compare what is in the pattern space against what is in the hold space (only how to copy to and from). Is this not possible?