mardi 17 décembre 2019

delete duplicate strings in file in bash )with a catch)

This is my input file

apple
apples
appleby
roth
rothman
boss
cat
cater
caters

Expected output

apple
roth
boss
cat
cater

As you can see, i need to remove content that match pattern and keep the shortest match (as above). Have been breaking my head on this. Any suggestions?

Aucun commentaire:

Enregistrer un commentaire