I have two unsorted lists of words, and I want to produce a new list excluding the words featuring some selected characters, and in order. I tried the following command:
cat roa7.lst gr7.usl | sed -e 's/\s/\n/g' | sed -n 's/[^hlrw]/&/p' | sort -u | less -N
However, the last sed command, which tries to exclude the lines containing the set of characters
[hlrw] fails to exclude these words. Somehow I'm missing the pragmatics of the caret within the delimiters. How can I fix this pipe?