I need to find the number of words in a file (1 word per line) that do not contain some set of letters. To do this I want to take the difference of
grep -c '.' <file> and
grep -c '<other_pattern>' <file>. I tried piping to bc with the following command
echo "(grep -c '.' <file>) - (grep -c '<other_pattern>' <file>)" | bc. The result simply said syntax error. I was hoping someone had insight as what syntax is necessary for bc to accept the results of the grep calls. I need to do this in a single command as well.
Thanks in advance.