remove_lines_with_duplicate_letters
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
remove_lines_with_duplicate_letters [2023/08/11 14:40] – removed - external edit (Unknown date) 127.0.0.1 | remove_lines_with_duplicate_letters [2023/08/27 23:48] (current) – raju | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Remove lines with duplicate letters ===== | ||
+ | ==== Task ==== | ||
+ | Find five letter words that are made up of letters {h, i, k, e, r, s} where each letter appears only once. | ||
+ | ==== Issue ==== | ||
+ | < | ||
+ | grep -Ei " | ||
+ | </ | ||
+ | gives | ||
+ | < | ||
+ | Essie | ||
+ | Hesse | ||
+ | Irish | ||
+ | Kerri | ||
+ | Reese | ||
+ | Sheri | ||
+ | ... | ||
+ | </ | ||
+ | where some letters are duplicated in some of the words. For example, the letter ' | ||
+ | |||
+ | ==== Solution ==== | ||
+ | Pipe the output to '' | ||
+ | |||
+ | < | ||
+ | % grep -Ei " | ||
+ | Sheri | ||
+ | Shrek | ||
+ | heirs | ||
+ | hiker | ||
+ | hikes | ||
+ | hires | ||
+ | sheik | ||
+ | shire | ||
+ | shirk | ||
+ | skier | ||
+ | </ | ||
+ | |||
+ | ==== Ref ==== | ||
+ | * https:// | ||
+ | * I got the idea from here. | ||
+ | * (Mastering Regular Expressions, | ||
+ | |||