How do I compare a list of unsorted words of variable length and remove duplicate words that have a suffix? Example word list:     iron            curl    curled    railroad    curler    curling    curls    irons    pan    pans    park    parker    parks    parked    railroadsExample Output:      iron    curl    railroad    pan    parkThe words all have different lengths, not just four or eight letters. I know how to search and print words containing suffixes but I'm not sure how to compare a list of words, some of which have suffixes, and then remove the words with suffixes, if there is a word that does not have a suffix on the list, without changing the sort order. 
How Do I Remove Duplicate Words With Suffixes?
shell;text processing;awk;sed;grep
This solution user 123 created for me on another question was able to strip suffixes reliably without mangling words. I wanted to come back and answer this question so that anyone seeking a similar solution could get a good answer.awk 'FNR==NR{a[$0 s]++;next}!($0 in a)' file.txt file.txtawk 'FNR==NR{a[$0 ed]++;next}!($0 in a)' file.txt file.txtawk 'FNR==NR{a[$0 ing]++;next}!($0 in a)' file.txt file.txtawk 'FNR==NR{a[$0 ness]++;next}!($0 in a)' file.txt file.txtawk 'FNR==NR{a[$0 er]++;next}!($0 in a)' file.txt file.txt