I have some dictionary to myspell in file.dic
. Let's say:
abc
aword
bword
cab
worda
wordzzz
and I'm looking for different words that are permutations (or anagrams) of each other.
If there was a command "letter-sort" I'd do it more or less like that:
cat file.dic | letter-sort | paste - file.dic | sort
That gives me:
abc abc
abc cab
adorw aword
adorw worda
bdorw bword
dorwzzz wordzzz
so now I clearly see anagrams in file. Is there such letters-sort
command or how to obtain such result in maybe some other way?
worda
becomeaword
? – pfnuesel Nov 17 '16 at 23:49adorw
- assuming order like in alphabet. – sZpak Nov 17 '16 at 23:51