Comment
Comment by adimitrov
The awk line for duplicate lines without changing ordering is… wow. Awk is such an underused tool (at least for me.) My solution was:
Ironically, it also involved awk! But I used it to prepend line numbers, which uniq and sort can ignore, then re-sort it according to line numbers. Very much not an ideal solution!