Hello my fellow Ubuntuers!
I have a scripting conundrum I'm trying to figure out; it involves removing a particular string from a large aliases file, as follows:
Code:
# original aliases file
various_different: various_different
emailaddresses: emailaddresses, emailaddresses
some-with-numbers0: some-with-numbers0, some-with-numbers0
some_with_special_chars: some_with_special_chars, some_with_special_chars
# desired aliases file
various_different: various_different
emailaddresses: emailaddresses
some-with-numbers0: some-with-numbers0
some_with_special_chars: some_with_special_chars
E.g.: I want to get rid of any triplicate entries on the same line but without disrupting the lines themselves. I believe some combination of arrays and awk can do this but am not sure how. Note that the triplicate entries may not be always be in a particular field.
Thanks all!
SuaSwe
Bookmarks